diff mercurial/commands.py @ 16992:55e7f352b1d3

graft: allow -r to specify revisions
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 20 Jun 2012 17:02:43 +0200
parents 1aae34f109fd
children fba17a64fa49
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Jun 20 16:49:04 2012 +0200
+++ b/mercurial/commands.py	Wed Jun 20 17:02:43 2012 +0200
@@ -2600,7 +2600,8 @@
 
 @command(
     'graft',
-    [('c', 'continue', False, _('resume interrupted graft')),
+    [('r', 'rev', [], _('revisions to graft'), _('REV')),
+     ('c', 'continue', False, _('resume interrupted graft')),
      ('e', 'edit', False, _('invoke editor on commit messages')),
      ('', 'log', None, _('append graft info to log message')),
      ('D', 'currentdate', False,
@@ -2608,7 +2609,7 @@
      ('U', 'currentuser', False,
       _('record the current user as committer'), _('DATE'))]
     + commitopts2 + mergetoolopts  + dryrunopts,
-    _('[OPTION]... REV...'))
+    _('[OPTION]... [-r] REV...'))
 def graft(ui, repo, *revs, **opts):
     '''copy changes from other branches onto the current branch
 
@@ -2658,6 +2659,9 @@
     Returns 0 on successful completion.
     '''
 
+    revs = list(revs)
+    revs.extend(opts['rev'])
+
     if not opts.get('user') and opts.get('currentuser'):
         opts['user'] = ui.username()
     if not opts.get('date') and opts.get('currentdate'):