Patchwork [4,of,5,stable,bid] merge: tell the user when we are using bid merge

login
register
mail settings
Submitter Mads Kiilerich
Date April 22, 2014, 12:24 a.m.
Message ID <e73e180e661c68d00701.1398126259@localhost.localdomain>
Download mbox | patch
Permalink /patch/4419/
State Accepted
Commit 33737ebc6f39af73c79348f59269001fe4cc6926
Headers show

Comments

Mads Kiilerich - April 22, 2014, 12:24 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1397820800 -7200
#      Fri Apr 18 13:33:20 2014 +0200
# Branch stable
# Node ID e73e180e661c68d00701078b9628feb44f4fe5fb
# Parent  bb27c515f6d4f902ab4f5b91d1fca5d8dfe7b1aa
merge: tell the user when we are using bid merge

Bid merge is a new rarely used feature that the user explicitly enabled - we
should tell/warn when the user actually is using it, just like we tell when we
not are using it.

Give a message like
  note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -730,6 +730,10 @@  def calculateupdates(repo, wctx, mctx, a
                                 partial, acceptremote, followcopies)
 
     else: # only when merge.preferancestor=* - experimentalish code
+        repo.ui.status(
+            _("note: merging %s and %s using bids from ancestors %s\n") %
+            (wctx, mctx, _(' and ').join(str(anc) for anc in ancestors)))
+
         # Call for bids
         fbids = {} # mapping filename to list af action bids
         for ancestor in ancestors:
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
@@ -128,6 +128,7 @@  Redo merge with merge.preferancestor="*"
   $ rm f*
   $ hg up -qC .
   $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
+  note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
   
   calculating bids for ancestor 0f6b37dbe527
     searching for copies back to rev 3
@@ -172,6 +173,7 @@  The other way around:
         alternatively, use --config merge.preferancestor=40663881a6dd
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge -v --debug --config merge.preferancestor="*"
+  note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
   
   calculating bids for ancestor 0f6b37dbe527
     searching for copies back to rev 3
@@ -212,11 +214,13 @@  Verify how the output looks and and how 
 
   $ hg up -qC
   $ hg merge --config merge.preferancestor="*"
+  note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ hg up -qC
   $ hg merge -v --config merge.preferancestor="*"
+  note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
   
   calculating bids for ancestor 0f6b37dbe527
   resolving manifests
@@ -235,6 +239,7 @@  Verify how the output looks and and how 
 
   $ hg up -qC
   $ hg merge -v --debug --config merge.preferancestor="*"
+  note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
   
   calculating bids for ancestor 0f6b37dbe527
     searching for copies back to rev 3
@@ -316,6 +321,7 @@  http://stackoverflow.com/questions/93500
   $ hg up -qC .
 
   $ hg merge -v --config merge.preferancestor="*"
+  note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
   
   calculating bids for ancestor 70008a2163f6
   resolving manifests