diff options
Diffstat (limited to 'subcmds/download.py')
-rw-r--r-- | subcmds/download.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/subcmds/download.py b/subcmds/download.py index 61eadd54..0ea45c3f 100644 --- a/subcmds/download.py +++ b/subcmds/download.py | |||
@@ -33,7 +33,15 @@ makes it available in your project's local working directory. | |||
33 | """ | 33 | """ |
34 | 34 | ||
35 | def _Options(self, p): | 35 | def _Options(self, p): |
36 | pass | 36 | p.add_option('-c','--cherry-pick', |
37 | dest='cherrypick', action='store_true', | ||
38 | help="cherry-pick instead of checkout") | ||
39 | p.add_option('-r','--revert', | ||
40 | dest='revert', action='store_true', | ||
41 | help="revert instead of checkout") | ||
42 | p.add_option('-f','--ff-only', | ||
43 | dest='ffonly', action='store_true', | ||
44 | help="force fast-forward merge") | ||
37 | 45 | ||
38 | def _ParseChangeIds(self, args): | 46 | def _ParseChangeIds(self, args): |
39 | if not args: | 47 | if not args: |
@@ -66,7 +74,7 @@ makes it available in your project's local working directory. | |||
66 | % (project.name, change_id, ps_id) | 74 | % (project.name, change_id, ps_id) |
67 | sys.exit(1) | 75 | sys.exit(1) |
68 | 76 | ||
69 | if not dl.commits: | 77 | if not opt.revert and not dl.commits: |
70 | print >>sys.stderr, \ | 78 | print >>sys.stderr, \ |
71 | '[%s] change %d/%d has already been merged' \ | 79 | '[%s] change %d/%d has already been merged' \ |
72 | % (project.name, change_id, ps_id) | 80 | % (project.name, change_id, ps_id) |
@@ -78,4 +86,11 @@ makes it available in your project's local working directory. | |||
78 | % (project.name, change_id, ps_id, len(dl.commits)) | 86 | % (project.name, change_id, ps_id, len(dl.commits)) |
79 | for c in dl.commits: | 87 | for c in dl.commits: |
80 | print >>sys.stderr, ' %s' % (c) | 88 | print >>sys.stderr, ' %s' % (c) |
81 | project._Checkout(dl.commit) | 89 | if opt.cherrypick: |
90 | project._CherryPick(dl.commit) | ||
91 | elif opt.revert: | ||
92 | project._Revert(dl.commit) | ||
93 | elif opt.ffonly: | ||
94 | project._FastForward(dl.commit, ffonly=True) | ||
95 | else: | ||
96 | project._Checkout(dl.commit) | ||