diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1179,17 +1179,21 @@ # Pick the best bid for each file repo.ui.note(_(b'\nauction for merging merge bids\n')) for f, bids in sorted(fbids.items()): + repo.ui.note(_(b" %s:\n list of bids:\n") % f) + for m, l in sorted(bids.items()): + for _f, args, msg in l: + repo.ui.note(b' %s -> %s\n' % (msg, m)) # bids is a mapping from action method to list af actions # Consensus? if len(bids) == 1: # all bids are the same kind of method m, l = list(bids.items())[0] if all(a == l[0] for a in l[1:]): # len(bids) is > 1 - repo.ui.note(_(b" %s: consensus for %s\n") % (f, m)) + repo.ui.note(_(b" consensus for %s\n") % (m)) mresult.addfile(f, *l[0]) continue # If keep is an option, just do it. if mergestatemod.ACTION_KEEP in bids: - repo.ui.note(_(b" %s: picking 'keep' action\n") % f) + repo.ui.note(_(b" picking 'keep' action\n")) mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP][0]) continue # If keep deleted is an option, just do that @@ -1201,20 +1205,14 @@ if mergestatemod.ACTION_GET in bids: ga0 = bids[mergestatemod.ACTION_GET][0] if all(a == ga0 for a in bids[mergestatemod.ACTION_GET][1:]): - repo.ui.note(_(b" %s: picking 'get' action\n") % f) + repo.ui.note(_(b" picking 'get' action\n")) mresult.addfile(f, *ga0) continue # TODO: Consider other simple actions such as mode changes # Handle inefficient democrazy. - repo.ui.note(_(b' %s: multiple bids for merge action:\n') % f) - for m, l in sorted(bids.items()): - for _f, args, msg in l: - repo.ui.note(b' %s -> %s\n' % (msg, m)) # Pick random action. TODO: Instead, prompt user when resolving m, l = list(bids.items())[0] - repo.ui.warn( - _(b' %s: ambiguous merge - picked %s action\n') % (f, m) - ) + repo.ui.warn(_(b' ambiguous merge - picked %s action\n') % (m)) mresult.addfile(f, *l[0]) continue repo.ui.note(_(b'end of auction\n\n')) diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t --- a/tests/test-merge-criss-cross.t +++ b/tests/test-merge-criss-cross.t @@ -150,8 +150,16 @@ f2: remote unchanged -> k auction for merging merge bids - f1: picking 'get' action - f2: picking 'keep' action + f1: + list of bids: + remote is newer -> g + versions differ -> m + picking 'get' action + f2: + list of bids: + remote unchanged -> k + versions differ -> m + picking 'keep' action end of auction f1: remote is newer -> g @@ -193,8 +201,16 @@ f2: remote is newer -> g auction for merging merge bids - f1: picking 'keep' action - f2: picking 'get' action + f1: + list of bids: + remote unchanged -> k + versions differ -> m + picking 'keep' action + f2: + list of bids: + remote is newer -> g + versions differ -> m + picking 'get' action end of auction f2: remote is newer -> g @@ -231,8 +247,16 @@ resolving manifests auction for merging merge bids - f1: picking 'get' action - f2: picking 'keep' action + f1: + list of bids: + remote is newer -> g + versions differ -> m + picking 'get' action + f2: + list of bids: + remote unchanged -> k + versions differ -> m + picking 'keep' action end of auction getting f1 @@ -258,8 +282,16 @@ f2: remote unchanged -> k auction for merging merge bids - f1: picking 'get' action - f2: picking 'keep' action + f1: + list of bids: + remote is newer -> g + versions differ -> m + picking 'get' action + f2: + list of bids: + remote unchanged -> k + versions differ -> m + picking 'keep' action end of auction f1: remote is newer -> g @@ -344,10 +376,11 @@ resolving manifests auction for merging merge bids - x: multiple bids for merge action: - versions differ -> m - versions differ -> m - x: ambiguous merge - picked m action + x: + list of bids: + versions differ -> m + versions differ -> m + ambiguous merge - picked m action end of auction merging x @@ -433,9 +466,21 @@ d2/b: remote created -> g auction for merging merge bids - d1/a: picking 'keep' action - d1/b: picking 'keep' action - d2/b: consensus for g + d1/a: + list of bids: + ancestor missing, remote missing -> k + other deleted -> r + picking 'keep' action + d1/b: + list of bids: + ancestor missing, remote missing -> k + other deleted -> r + picking 'keep' action + d2/b: + list of bids: + remote created -> g + remote created -> g + consensus for g end of auction d2/b: remote created -> g