Mercurial > hg-stable
diff mercurial/commands.py @ 15239:f5d9d0d0f588
graft: add --edit
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 12 Oct 2011 18:46:03 -0500 |
parents | 2d710c12ffc0 |
children | bfb93963bb39 |
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