1 From c1e0ee2bca8c8965b8f382246c9570f187638090 Mon Sep 17 00:00:00 2001
2 From: Aurelien Gateau <agateau@kde.org>
3 Date: Fri, 15 Jan 2010 12:03:02 +0100
4 Subject: [PATCH 2/2] Added bzr support
8 src/cliopt.cc | 6 ++++++
10 3 files changed, 12 insertions(+), 0 deletions(-)
12 diff --git a/src/cliargs.cc b/src/cliargs.cc
13 index 293ce4f..51d76fa 100644
16 @@ -159,6 +159,7 @@ void CliArgs::printHelp(void) const
17 cerr << " --preserve : same as -p (preserve .orig files)"<< endl;
18 cerr << " --hg or --mercurial : Mercurial RCS rename support" << endl;
19 cerr << " --git : Git RCS rename support" << endl;
20 + cerr << " --bzr or --bazaar : Bazaar RCS rename support" << endl;
21 cerr << " --mv or --plain : (default) plain Unix rename" << endl;
24 diff --git a/src/cliopt.cc b/src/cliopt.cc
25 index 0a8e20a..db6e85f 100644
28 @@ -29,6 +29,8 @@ bool CliOpt::handle_arg(const char *str)
29 { renamer = new SvnRename(); return retval; }
30 if (strcmp(str, "--git") == 0)
31 { renamer = new GitRename(); return retval; }
32 + if (strcmp(str, "--bzr") == 0 || strcmp(str, "--bazaar") == 0)
33 + { renamer = new BzrRename(); return retval; }
34 if (strcmp(str, "--mv") == 0 || strcmp(str, "--plain") == 0)
35 { renamer = new PlainRename(); return retval; }
37 @@ -73,6 +75,10 @@ int GitRename::rename(const char *oldname, const char *newname, bool preserve_mo
38 return standard_renamer("git", "mv", oldname, newname);
41 +int BzrRename::rename(const char *oldname, const char *newname, bool preserve_mode) {
42 + return standard_renamer("bzr", "mv", oldname, newname);
45 int PlainRename::rename(const char *oldname, const char *newname, bool preserve_mode) {
46 return ::rename(oldname, newname);
48 diff --git a/src/cliopt.h b/src/cliopt.h
49 index 5d633d6..a3e7d31 100644
52 @@ -26,6 +26,11 @@ class GitRename : public RenameCommand {
53 virtual int rename(const char *oldpath, const char *newpath, bool preserve_mode);
56 +class BzrRename : public RenameCommand {
58 + virtual int rename(const char *oldpath, const char *newpath, bool preserve_mode);