# HG changeset patch # User FUJIWARA Katsunori # Date 2014-05-31 15:08:32 # Node ID 51035af2c0bfb988aadf273ff5c68bcd5e125b22 # Parent 0986af9e7006d8912843e13758dd60377a340cfd backout: accept '--edit' like other commands creating new changeset After this patch, users can invoke editor for the commit message by '--edit' option regardless of '--message'/'--logfile'. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -386,6 +386,7 @@ def archive(ui, repo, dest, **opts): ('', 'parent', '', _('parent to choose when backing out merge (DEPRECATED)'), _('REV')), ('r', 'rev', '', _('revision to backout'), _('REV')), + ('e', 'edit', False, _('invoke editor on commit messages')), ] + mergetoolopts + walkopts + commitopts + commitopts2, _('[OPTION]... [-r] REV')) def backout(ui, repo, node=None, rev=None, **opts): @@ -488,7 +489,7 @@ def backout(ui, repo, node=None, rev=Non def commitfunc(ui, repo, message, match, opts): - e = cmdutil.getcommiteditor() + e = cmdutil.getcommiteditor(**opts) if not message: # we don't translate commit messages message = "Backed out changeset %s" % short(node) diff --git a/tests/test-backout.t b/tests/test-backout.t --- a/tests/test-backout.t +++ b/tests/test-backout.t @@ -355,9 +355,21 @@ without --merge update: (current) with --merge +(this also tests that editor is invoked if '--edit' is specified +explicitly regardless of '--message') + $ hg update -qC - $ hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true + $ HGEDITOR=cat hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true --edit removing file1 + backout on branch1 + + + HG: Enter commit message. Lines beginning with 'HG:' are removed. + HG: Leave message empty to abort commit. + HG: -- + HG: user: test + HG: branch 'branch2' + HG: removed file1 created new head changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3 merging with changeset 3:d4e8f6db59fb diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -215,7 +215,7 @@ Show all commands + options update: clean, check, date, rev, tool addremove: similarity, include, exclude, dry-run archive: no-decode, prefix, rev, type, subrepos, include, exclude - backout: merge, parent, rev, tool, include, exclude, message, logfile, date, user + backout: merge, parent, rev, edit, tool, include, exclude, message, logfile, date, user bisect: reset, good, bad, skip, extend, command, noupdate bookmarks: force, rev, delete, rename, inactive branch: force, clean