# HG changeset patch # User Matt Mackall # Date 1318463163 18000 # Node ID f5d9d0d0f58804558dd83ca50c5232cf268daabd # Parent 2d710c12ffc0cef637fe19d53aed48803047c090 graft: add --edit diff -r 2d710c12ffc0 -r f5d9d0d0f588 mercurial/commands.py --- 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 diff -r 2d710c12ffc0 -r f5d9d0d0f588 tests/test-debugcomplete.t --- 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