changeset 45447:e7c8a5030a90

merge: show number of ancestors in bid merge debug notes A good number of times, we don't generate an action for a file in manifestmerge() which can result in bid merge doing the wrong thing. Mentioning the number of ancestors from which we are bidding will help spot such cases where we are not returning an action. Differential Revision: https://phab.mercurial-scm.org/D8967
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 26 Aug 2020 17:24:22 +0530
parents 00e4e97c6bc8
children 85b03b1e4715
files mercurial/merge.py tests/test-merge-criss-cross.t
diffstat 2 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Sep 03 14:45:16 2020 +0530
+++ b/mercurial/merge.py	Wed Aug 26 17:24:22 2020 +0530
@@ -1151,7 +1151,10 @@
 
         # Call for bids
         # Pick the best bid for each file
-        repo.ui.note(_(b'\nauction for merging merge bids\n'))
+        repo.ui.note(
+            _(b'\nauction for merging merge bids (%d ancestors)\n')
+            % len(ancestors)
+        )
         mresult = mergeresult()
         for f, bids in sorted(fbids.items()):
             # bids is a mapping from action method to list af actions
--- a/tests/test-merge-criss-cross.t	Thu Sep 03 14:45:16 2020 +0530
+++ b/tests/test-merge-criss-cross.t	Wed Aug 26 17:24:22 2020 +0530
@@ -149,7 +149,7 @@
    f1: versions differ -> m
    f2: remote unchanged -> k
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    f1: picking 'get' action
    f2: picking 'keep' action
   end of auction
@@ -192,7 +192,7 @@
    f1: versions differ -> m
    f2: remote is newer -> g
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    f1: picking 'keep' action
    f2: picking 'get' action
   end of auction
@@ -230,7 +230,7 @@
   calculating bids for ancestor 40663881a6dd
   resolving manifests
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    f1: picking 'get' action
    f2: picking 'keep' action
   end of auction
@@ -257,7 +257,7 @@
    f1: versions differ -> m
    f2: remote unchanged -> k
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    f1: picking 'get' action
    f2: picking 'keep' action
   end of auction
@@ -343,7 +343,7 @@
   calculating bids for ancestor b211bbc6eb3c
   resolving manifests
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    x: multiple bids for merge action:
     versions differ -> m
     versions differ -> m
@@ -430,7 +430,7 @@
    d1/b: other deleted -> r
    d2/b: remote created -> g
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    d1/a: consensus for r
    d1/b: consensus for r
    d2/b: consensus for g