Patchwork [4,of,5] summary: add other/local markers for merges [RFC]

login
register
mail settings
Submitter timeless@mozdev.org
Date March 22, 2016, 10:21 p.m.
Message ID <f15f750596a11d998dec.1458685311@waste.org>
Download mbox | patch
Permalink /patch/14030/
State Superseded
Headers show

Comments

timeless@mozdev.org - March 22, 2016, 10:21 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1458683883 0
#      Tue Mar 22 21:58:03 2016 +0000
# Node ID f15f750596a11d998decd1753e99ae732d301b69
# Parent  e17caa0aae2559b41c0016c6a432029c2da5c9c2
summary: add other/local markers for merges [RFC]

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6599,6 +6599,20 @@ 
             else:
                 ui.write(_(' (no revision checked out)'))
         ui.write('\n')
+        if len(parents) == 2:
+            merging = ''
+            # these are not for translation
+            if ms is not None:
+                if p == ms.localctx:
+                    merging = 'local'
+                elif p == ms.otherctx:
+                    merging = 'other'
+            else:
+                if p == parents[0]:
+                    merging = 'local'
+                elif p == parents[1]:
+                    merging = 'other'
+            ui.write(_('merging: %s\n') % merging)
         if p.description():
             ui.status(' ' + p.description().splitlines()[0].strip() + '\n',
                       label='log.summary')
diff --git a/tests/test-backout.t b/tests/test-backout.t
--- a/tests/test-backout.t
+++ b/tests/test-backout.t
@@ -551,8 +551,10 @@ 
   (branch merge, don't forget to commit)
   $ hg summary
   parent: 2:45bbcd363bf0 
+  merging: local
    file2
   parent: 3:d4e8f6db59fb tip
+  merging: other
    backout on branch1
   branch: branch2
   commit: 1 removed (merge)
diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -471,8 +471,10 @@ 
 
   $ hg summary
   parent: 1:56daeba07f4b 
+  merging: local
    c2
   parent: 2:e4e3f3546619 tip
+  merging: other
    c2b
   branch: default
   commit: 1 modified, 1 unresolved (merge)
diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -334,8 +334,10 @@ 
   $ hg summary
   warning: merge state has unsupported record types: X
   parent: 2:57653b9f834a 
+  merging: local
    append baz to files
   parent: 1:dc77451844e3 
+  merging: other
    append bar to files
   branch: default
   commit: 2 modified, 2 unknown (merge)
diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -404,8 +404,10 @@ 
   (branch merge, don't forget to commit)
   $ hg summary
   parent: 2:b8ec310b2d4e tip
+  merging: local
    other adds
   parent: 1:f6180deb8fbe 
+  merging: other
    rename
   branch: default
   commit: 2 modified, 1 removed (merge)