Patchwork merge: also allow 'e' action with experimental.updatecheck=noconflict

login
register
mail settings
Submitter via Mercurial-devel
Date March 14, 2017, 5:16 a.m.
Message ID <bed0d8465c94c4f19f3b.1489468579@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/19324/
State Accepted
Headers show

Comments

via Mercurial-devel - March 14, 2017, 5:16 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1489467523 25200
#      Mon Mar 13 21:58:43 2017 -0700
# Node ID bed0d8465c94c4f19f3bc32b8e427b2d23fa6cda
# Parent  3d3109339b57341b333c1112beb41dd281fa944a
merge: also allow 'e' action with experimental.updatecheck=noconflict

With experimental.updatecheck=noconflict set, if one checks out
f3398f1f70a0 (tests: add execute bit and fix shbang line, 2015-12-22)
and then try to check out its parent, hg will complain about
conflicting changes, even though the working directory is clean. We
need to also allow the 'e' action in merge.py. The 'e' action is used
when moving to a commit where the only change to the file is to its
executable flag, so it's just an optimized 'g' action.

Doesn't seem to be worth writing a test for, since the existing setup
in test-update-branches.t does not set any flags.
Yuya Nishihara - March 17, 2017, 1:18 p.m.
On Mon, 13 Mar 2017 22:16:19 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1489467523 25200
> #      Mon Mar 13 21:58:43 2017 -0700
> # Node ID bed0d8465c94c4f19f3bc32b8e427b2d23fa6cda
> # Parent  3d3109339b57341b333c1112beb41dd281fa944a
> merge: also allow 'e' action with experimental.updatecheck=noconflict

Makes sense. Queued, thanks.

Patch

diff -r 3d3109339b57 -r bed0d8465c94 mercurial/merge.py
--- a/mercurial/merge.py	Mon Mar 13 11:19:24 2017 -0700
+++ b/mercurial/merge.py	Mon Mar 13 21:58:43 2017 -0700
@@ -1600,7 +1600,7 @@ 
 
         if updatecheck == 'noconflict':
             for f, (m, args, msg) in actionbyfile.iteritems():
-                if m not in ('g', 'k', 'r'):
+                if m not in ('g', 'k', 'e', 'r'):
                     msg = _("conflicting changes")
                     hint = _("commit or update --clean to discard changes")
                     raise error.Abort(msg, hint=hint)