bidmerge: choose shortest list of diverge and rename/delete warnings
authorMatt Mackall <mpm@selenic.com>
Wed, 19 Aug 2015 14:05:42 -0500
changeset 26318 d3bd6cefd742
parent 26317 07ac78ba2e37
child 26319 4b9bb1616195
bidmerge: choose shortest list of diverge and rename/delete warnings Slightly less arbitrary than choosing the first set.
mercurial/merge.py
--- a/mercurial/merge.py	Wed Aug 19 14:04:54 2015 -0500
+++ b/mercurial/merge.py	Wed Aug 19 14:05:42 2015 -0500
@@ -596,10 +596,14 @@
                 repo, wctx, mctx, ancestor, branchmerge, force, partial,
                 acceptremote, followcopies)
             _checkunknownfiles(repo, wctx, mctx, force, actions)
-            if diverge is None: # and renamedelete is None.
-                # Arbitrarily pick warnings from first iteration
+
+            # Track the shortest set of warning on the theory that bid
+            # merge will correctly incorporate more information
+            if diverge is None or len(diverge1) < len(diverge):
                 diverge = diverge1
+            if renamedelete is None or len(renamedelete) < len(renamedelete1):
                 renamedelete = renamedelete1
+
             for f, a in sorted(actions.iteritems()):
                 m, args, msg = a
                 repo.ui.debug(' %s: %s -> %s\n' % (f, msg, m))