diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/download.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/subcmds/download.py b/subcmds/download.py index 79d0192d..f79f485b 100644 --- a/subcmds/download.py +++ b/subcmds/download.py | |||
| @@ -36,6 +36,9 @@ makes it available in your project's local working directory. | |||
| 36 | p.add_option('-c','--cherry-pick', | 36 | p.add_option('-c','--cherry-pick', |
| 37 | dest='cherrypick', action='store_true', | 37 | dest='cherrypick', action='store_true', |
| 38 | help="cherry-pick instead of checkout") | 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") | ||
| 39 | 42 | ||
| 40 | def _ParseChangeIds(self, args): | 43 | def _ParseChangeIds(self, args): |
| 41 | if not args: | 44 | if not args: |
| @@ -68,7 +71,7 @@ makes it available in your project's local working directory. | |||
| 68 | % (project.name, change_id, ps_id) | 71 | % (project.name, change_id, ps_id) |
| 69 | sys.exit(1) | 72 | sys.exit(1) |
| 70 | 73 | ||
| 71 | if not dl.commits: | 74 | if not opt.revert and not dl.commits: |
| 72 | print >>sys.stderr, \ | 75 | print >>sys.stderr, \ |
| 73 | '[%s] change %d/%d has already been merged' \ | 76 | '[%s] change %d/%d has already been merged' \ |
| 74 | % (project.name, change_id, ps_id) | 77 | % (project.name, change_id, ps_id) |
| @@ -82,5 +85,7 @@ makes it available in your project's local working directory. | |||
| 82 | print >>sys.stderr, ' %s' % (c) | 85 | print >>sys.stderr, ' %s' % (c) |
| 83 | if opt.cherrypick: | 86 | if opt.cherrypick: |
| 84 | project._CherryPick(dl.commit) | 87 | project._CherryPick(dl.commit) |
| 88 | elif opt.revert: | ||
| 89 | project._Revert(dl.commit) | ||
| 85 | else: | 90 | else: |
| 86 | project._Checkout(dl.commit) | 91 | project._Checkout(dl.commit) |
