changeset 15239:f5d9d0d0f588

graft: add --edit
author Matt Mackall <mpm@selenic.com>
date Wed, 12 Oct 2011 18:46:03 -0500
parents 2d710c12ffc0
children bfb93963bb39
files mercurial/commands.py tests/test-debugcomplete.t
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Oct 12 18:45:36 2011 -0500
+++ b/mercurial/commands.py	Wed Oct 12 18:46:03 2011 -0500
@@ -2448,7 +2448,7 @@
     return errs
 
 @command('graft',
-    [],
+    [('e', 'edit', False, _('invoke editor on commit messages'))],
     _('[OPTION]... REVISION...'))
 def graft(ui, repo, rev, *revs, **opts):
     '''copy changes from other branches onto the current branch
@@ -2466,6 +2466,10 @@
 
     cmdutil.bailifchanged(repo)
 
+    editor = None
+    if opts.get('edit'):
+        editor = cmdutil.commitforceeditor
+
     revs = [rev] + list(revs)
     revs = scmutil.revrange(repo, revs)
 
@@ -2512,7 +2516,7 @@
         # commit
         extra = {'source': ctx.hex()}
         repo.commit(text=ctx.description(), user=ctx.user(),
-                    date=ctx.date(), extra=extra)
+                    date=ctx.date(), extra=extra, editor=editor)
 
     return 0
 
--- a/tests/test-debugcomplete.t	Wed Oct 12 18:45:36 2011 -0500
+++ b/tests/test-debugcomplete.t	Wed Oct 12 18:46:03 2011 -0500
@@ -243,7 +243,7 @@
   debugsub: rev
   debugwalk: include, exclude
   debugwireargs: three, four, five, ssh, remotecmd, insecure
-  graft: 
+  graft: edit
   grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude
   heads: rev, topo, active, closed, style, template
   help: extension, command