Patchwork D8967: merge: show number of ancestors in bid merge debug notes

login
register
mail settings
Submitter phabricator
Date Aug. 27, 2020, 9:39 a.m.
Message ID <differential-rev-PHID-DREV-kecdpop6xsldvh752yic-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47068/
State Superseded
Headers show

Comments

phabricator - Aug. 27, 2020, 9:39 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8967

AFFECTED FILES
  mercurial/merge.py
  tests/test-merge-criss-cross.t

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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
@@ -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:
      list of bids:
        remote is newer -> g
@@ -200,7 +200,7 @@ 
    f1: versions differ -> m
    f2: remote is newer -> g
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    f1:
      list of bids:
        remote unchanged -> k
@@ -246,7 +246,7 @@ 
   calculating bids for ancestor 40663881a6dd
   resolving manifests
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    f1:
      list of bids:
        remote is newer -> g
@@ -281,7 +281,7 @@ 
    f1: versions differ -> m
    f2: remote unchanged -> k
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    f1:
      list of bids:
        remote is newer -> g
@@ -375,7 +375,7 @@ 
   calculating bids for ancestor b211bbc6eb3c
   resolving manifests
   
-  auction for merging merge bids
+  auction for merging merge bids (2 ancestors)
    x:
      list of bids:
        versions differ -> m
@@ -465,7 +465,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:
      list of bids:
        ancestor missing, remote missing -> k
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1173,7 +1173,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)
+        )
         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()):