updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / msrp / msrp-0.9.4-0002-bzr-support.diff
blob28ee11a03ff2228c20dddd6a1211feeb68ce5bea
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
6 ---
7 src/cliargs.cc | 1 +
8 src/cliopt.cc | 6 ++++++
9 src/cliopt.h | 5 +++++
10 3 files changed, 12 insertions(+), 0 deletions(-)
12 diff --git a/src/cliargs.cc b/src/cliargs.cc
13 index 293ce4f..51d76fa 100644
14 --- a/src/cliargs.cc
15 +++ b/src/cliargs.cc
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;
22 cerr << endl;
24 diff --git a/src/cliopt.cc b/src/cliopt.cc
25 index 0a8e20a..db6e85f 100644
26 --- a/src/cliopt.cc
27 +++ b/src/cliopt.cc
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; }
36 return false;
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
50 --- a/src/cliopt.h
51 +++ b/src/cliopt.h
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 {
57 + public:
58 + virtual int rename(const char *oldpath, const char *newpath, bool preserve_mode);
59 +};
61 class CliOpt {
62 public:
63 CliOpt(void) {
64 --
65 1.6.3.3