Patchwork [1,of,7,v2] merge: make debug output slightly more helpful by including message for action

login
register
mail settings
Submitter Mads Kiilerich
Date May 9, 2014, 12:06 a.m.
Message ID <b987a7a84823bf808939.1399593965@localhost.localdomain>
Download mbox | patch
Permalink /patch/4678/
State Accepted
Headers show

Comments

Mads Kiilerich - May 9, 2014, 12:06 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1398125364 -7200
#      Tue Apr 22 02:09:24 2014 +0200
# Node ID b987a7a84823bf808939e4ac1838a5c963f510cd
# Parent  62a2749895e4151f766a4243fa870b1ddd7386d0
merge: make debug output slightly more helpful by including message for action

Make recently introduced messages more useful. Instead of:
  f1: g
  f2: m
say:
  f1: remote is newer -> g
  f2: versions differ -> m
Pierre-Yves David - May 9, 2014, 7:48 a.m.
On 05/08/2014 05:06 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1398125364 -7200
> #      Tue Apr 22 02:09:24 2014 +0200
> # Node ID b987a7a84823bf808939e4ac1838a5c963f510cd
> # Parent  62a2749895e4151f766a4243fa870b1ddd7386d0
> merge: make debug output slightly more helpful by including message for action

This patches has been queued in the clowncopter. I'll queue a V3 of the 
series that does not breal test-add.t for most of its patches.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -742,8 +742,8 @@  def calculateupdates(repo, wctx, mctx, a
                                     branchmerge, force,
                                     partial, acceptremote, followcopies)
             for a in sorted(actions):
-                repo.ui.debug(' %s: %s\n' % (a[0], a[1]))
-                f = a[0]
+                f, m, args, msg = a
+                repo.ui.debug(' %s: %s -> %s\n' % (f, msg, m))
                 if f in fbids:
                     fbids[f].append(a)
                 else:
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
@@ -135,16 +135,16 @@  Redo merge with merge.preferancestor="*"
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
-   f1: g
-   f2: m
+   f1: remote is newer -> g
+   f2: versions differ -> m
   
   calculating bids for ancestor 40663881a6dd
     searching for copies back to rev 3
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
-   f1: m
-   f2: k
+   f1: versions differ -> m
+   f2: keep -> k
   
   auction for merging merge bids
    f1: picking 'get' action
@@ -180,16 +180,16 @@  The other way around:
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
-   f1: k
-   f2: m
+   f1: keep -> k
+   f2: versions differ -> m
   
   calculating bids for ancestor 40663881a6dd
     searching for copies back to rev 3
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
-   f1: m
-   f2: g
+   f1: versions differ -> m
+   f2: remote is newer -> g
   
   auction for merging merge bids
    f1: picking 'keep' action
@@ -246,16 +246,16 @@  Verify how the output looks and and how 
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
-   f1: g
-   f2: m
+   f1: remote is newer -> g
+   f2: versions differ -> m
   
   calculating bids for ancestor 40663881a6dd
     searching for copies back to rev 3
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
-   f1: m
-   f2: k
+   f1: versions differ -> m
+   f2: keep -> k
   
   auction for merging merge bids
    f1: picking 'get' action