Patchwork merge: add conflict labels to merge command

login
register
mail settings
Submitter Simon Farnsworth
Date Oct. 8, 2016, 8:26 a.m.
Message ID <9293c425580b06b3ab10.1475915172@devvm022.lla2.facebook.com>
Download mbox | patch
Permalink /patch/16908/
State Accepted
Headers show

Comments

Simon Farnsworth - Oct. 8, 2016, 8:26 a.m.
# HG changeset patch
# User Simon Farnsworth <simonfar@fb.com>
# Date 1475855510 25200
#      Fri Oct 07 08:51:50 2016 -0700
# Node ID 9293c425580b06b3ab10f9648b35e4a982cc5c67
# Parent  91a3c58ecf938ed675f5364b88f0d663f12b0047
merge: add conflict labels to merge command

Now that we present the conflict labels in prompts, it's useful to have
better names than "local" and "other" for every command.
Pierre-Yves David - Oct. 8, 2016, 9:31 a.m.
On 10/08/2016 10:26 AM, Simon Farnsworth wrote:
> # HG changeset patch
> # User Simon Farnsworth <simonfar@fb.com>
> # Date 1475855510 25200
> #      Fri Oct 07 08:51:50 2016 -0700
> # Node ID 9293c425580b06b3ab10f9648b35e4a982cc5c67
> # Parent  91a3c58ecf938ed675f5364b88f0d663f12b0047
> merge: add conflict labels to merge command

Pushed, thanks, test-subrepo-git.t and test-subrepo.t says hi.

Cheers,
Simon Farnsworth - Oct. 8, 2016, 9:35 a.m.
On 08/10/2016 11:31, Pierre-Yves David wrote:
> On 10/08/2016 10:26 AM, Simon Farnsworth wrote:
>> # HG changeset patch
>> # User Simon Farnsworth <simonfar@fb.com>
>> # Date 1475855510 25200
>> #      Fri Oct 07 08:51:50 2016 -0700
>> # Node ID 9293c425580b06b3ab10f9648b35e4a982cc5c67
>> # Parent  91a3c58ecf938ed675f5364b88f0d663f12b0047
>> merge: add conflict labels to merge command
>
> Pushed, thanks, test-subrepo-git.t and test-subrepo.t says hi.
>
> Cheers,
>

They pass for me without fixups - I'm running git v2.9.3 and running the 
test suite with ./run-tests.py -l -j24.

I see a failure in test-paths.t, because zeroconf assumes I have IPv4 
locally (I don't). Even if I run those two tests individually, I don't 
see issues.
Pierre-Yves David - Oct. 8, 2016, 9:37 a.m.
On 10/08/2016 11:35 AM, Simon Farnsworth wrote:
> On 08/10/2016 11:31, Pierre-Yves David wrote:
>> On 10/08/2016 10:26 AM, Simon Farnsworth wrote:
>>> # HG changeset patch
>>> # User Simon Farnsworth <simonfar@fb.com>
>>> # Date 1475855510 25200
>>> #      Fri Oct 07 08:51:50 2016 -0700
>>> # Node ID 9293c425580b06b3ab10f9648b35e4a982cc5c67
>>> # Parent  91a3c58ecf938ed675f5364b88f0d663f12b0047
>>> merge: add conflict labels to merge command
>>
>> Pushed, thanks, test-subrepo-git.t and test-subrepo.t says hi.
>>
>> Cheers,
>>
>
> They pass for me without fixups - I'm running git v2.9.3 and running the
> test suite with ./run-tests.py -l -j24.
>
> I see a failure in test-paths.t, because zeroconf assumes I have IPv4
> locally (I don't). Even if I run those two tests individually, I don't
> see issues.

I'm running 2.9.3. Can you check the changesets I pushed on hg-committed?

Cheers,
Simon Farnsworth - Oct. 8, 2016, 9:43 a.m.
On 08/10/2016 11:37, Pierre-Yves David wrote:
> On 10/08/2016 11:35 AM, Simon Farnsworth wrote:
>> On 08/10/2016 11:31, Pierre-Yves David wrote:
>>> On 10/08/2016 10:26 AM, Simon Farnsworth wrote:
>>>> # HG changeset patch
>>>> # User Simon Farnsworth <simonfar@fb.com>
>>>> # Date 1475855510 25200
>>>> #      Fri Oct 07 08:51:50 2016 -0700
>>>> # Node ID 9293c425580b06b3ab10f9648b35e4a982cc5c67
>>>> # Parent  91a3c58ecf938ed675f5364b88f0d663f12b0047
>>>> merge: add conflict labels to merge command
>>>
>>> Pushed, thanks, test-subrepo-git.t and test-subrepo.t says hi.
>>>
>>> Cheers,
>>>
>>
>> They pass for me without fixups - I'm running git v2.9.3 and running the
>> test suite with ./run-tests.py -l -j24.
>>
>> I see a failure in test-paths.t, because zeroconf assumes I have IPv4
>> locally (I don't). Even if I run those two tests individually, I don't
>> see issues.
>
> I'm running 2.9.3. Can you check the changesets I pushed on hg-committed?
>

They look OK - I can't work out what's triggering the discrepancy 
between tests on my system and tests on yours.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5532,7 +5532,9 @@ 
         # ui.forcemerge is an internal variable, do not document
         repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'merge')
         force = opts.get('force')
-        return hg.merge(repo, node, force=force, mergeforce=force)
+        labels = ['working copy', 'merge rev']
+        return hg.merge(repo, node, force=force, mergeforce=force,
+                        labels=labels)
     finally:
         ui.setconfig('ui', 'forcemerge', '', 'merge')
 
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -768,10 +768,11 @@ 
 
     return ret
 
-def merge(repo, node, force=None, remind=True, mergeforce=False):
+def merge(repo, node, force=None, remind=True, mergeforce=False, labels=None):
     """Branch merge with node, resolving changes. Return true if any
     unresolved conflicts."""
-    stats = mergemod.update(repo, node, True, force, mergeforce=mergeforce)
+    stats = mergemod.update(repo, node, True, force, mergeforce=mergeforce,
+                            labels=labels)
     _showstats(repo, stats)
     if stats[3]:
         repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -638,7 +638,7 @@ 
   (no more unresolved files)
   $ hg ci -m 'merge bar'
   $ hg log --config diff.git=1 -pr .
-  changeset:   23:93cd4445f720
+  changeset:   23:69c24fe01e35
   tag:         tip
   parent:      22:30d96aeaf27b
   parent:      21:1aa437659d19
@@ -653,11 +653,11 @@ 
   --- a/cc
   +++ b/cc
   @@ -1,1 +1,5 @@
-  +<<<<<<< local: 30d96aeaf27b - test: aa
+  +<<<<<<< working copy: 30d96aeaf27b - test: aa
    dd
   +=======
   +cc
-  +>>>>>>> other: 1aa437659d19  bar - test: aazzcc
+  +>>>>>>> merge rev:    1aa437659d19  bar - test: aazzcc
   diff --git a/z b/zz
   rename from z
   rename to zz
@@ -671,7 +671,7 @@ 
   $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
   HGEDITFORM=commit.amend.merge
   $ hg log --config diff.git=1 -pr .
-  changeset:   24:832b50f2c271
+  changeset:   24:cfa2fbef3169
   tag:         tip
   parent:      22:30d96aeaf27b
   parent:      21:1aa437659d19
@@ -686,11 +686,11 @@ 
   --- a/cc
   +++ b/cc
   @@ -1,1 +1,5 @@
-  +<<<<<<< local: 30d96aeaf27b - test: aa
+  +<<<<<<< working copy: 30d96aeaf27b - test: aa
    dd
   +=======
   +cc
-  +>>>>>>> other: 1aa437659d19  bar - test: aazzcc
+  +>>>>>>> merge rev:    1aa437659d19  bar - test: aazzcc
   diff --git a/z b/zz
   rename from z
   rename to zz
@@ -704,7 +704,7 @@ 
   $ hg mv zz z
   $ hg ci --amend -m 'merge bar (undo rename)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   26:bdafc5c72f74
+  changeset:   26:c34de68b014c
   tag:         tip
   parent:      22:30d96aeaf27b
   parent:      21:1aa437659d19
@@ -719,11 +719,11 @@ 
   --- a/cc
   +++ b/cc
   @@ -1,1 +1,5 @@
-  +<<<<<<< local: 30d96aeaf27b - test: aa
+  +<<<<<<< working copy: 30d96aeaf27b - test: aa
    dd
   +=======
   +cc
-  +>>>>>>> other: 1aa437659d19  bar - test: aazzcc
+  +>>>>>>> merge rev:    1aa437659d19  bar - test: aazzcc
   
   $ hg debugrename z
   z not renamed
@@ -740,9 +740,9 @@ 
   $ echo aa >> aaa
   $ hg ci -m 'merge bar again'
   $ hg log --config diff.git=1 -pr .
-  changeset:   28:32f19415b634
+  changeset:   28:37d40dcef03b
   tag:         tip
-  parent:      26:bdafc5c72f74
+  parent:      26:c34de68b014c
   parent:      27:4c94d5bc65f5
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -775,9 +775,9 @@ 
   $ hg mv aaa aa
   $ hg ci --amend -m 'merge bar again (undo rename)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   30:1e2a06b3d312
+  changeset:   30:537c6d1b3633
   tag:         tip
-  parent:      26:bdafc5c72f74
+  parent:      26:c34de68b014c
   parent:      27:4c94d5bc65f5
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -813,13 +813,13 @@ 
   $ hg merge -q bar --config ui.interactive=True << EOF
   > c
   > EOF
-  local changed aa which other deleted
+  local [working copy] changed aa which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? c
   $ hg ci -m 'merge bar (with conflicts)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   33:97a298b0c59f
+  changeset:   33:7afcba911942
   tag:         tip
-  parent:      32:3d78ce4226b8
+  parent:      32:6075d69d215d
   parent:      31:67db8847a540
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -829,9 +829,9 @@ 
   $ hg rm aa
   $ hg ci --amend -m 'merge bar (with conflicts, amended)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   35:6de0c1bde1c8
+  changeset:   35:376965e47ddd
   tag:         tip
-  parent:      32:3d78ce4226b8
+  parent:      32:6075d69d215d
   parent:      31:67db8847a540
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -927,7 +927,7 @@ 
   HG: M: 
   HG: A: foo
   HG: R: 
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 376965e47ddd foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -941,12 +941,12 @@ 
   HG: M: 
   HG: A: foo y
   HG: R: 
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 376965e47ddd foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 376965e47ddd y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -959,18 +959,18 @@ 
   HG: M: 
   HG: A: foo y
   HG: R: a
-  HG: diff -r 6de0c1bde1c8 a
+  HG: diff -r 376965e47ddd a
   HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,2 +0,0 @@
   HG: -a
   HG: -a
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 376965e47ddd foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 376965e47ddd y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -983,23 +983,23 @@ 
   HG: M: 
   HG: A: foo y
   HG: R: a x
-  HG: diff -r 6de0c1bde1c8 a
+  HG: diff -r 376965e47ddd a
   HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,2 +0,0 @@
   HG: -a
   HG: -a
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 376965e47ddd foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 x
+  HG: diff -r 376965e47ddd x
   HG: --- a/x	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,1 +0,0 @@
   HG: -x
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 376965e47ddd y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
@@ -1014,23 +1014,23 @@ 
   HG: M: 
   HG: A: foo y
   HG: R: a x
-  HG: diff -r 6de0c1bde1c8 a
+  HG: diff -r 376965e47ddd a
   HG: --- a/a	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,2 +0,0 @@
   HG: -a
   HG: -a
-  HG: diff -r 6de0c1bde1c8 foo
+  HG: diff -r 376965e47ddd foo
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
   HG: +foo
-  HG: diff -r 6de0c1bde1c8 x
+  HG: diff -r 376965e47ddd x
   HG: --- a/x	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -1,1 +0,0 @@
   HG: -x
-  HG: diff -r 6de0c1bde1c8 y
+  HG: diff -r 376965e47ddd y
   HG: --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   HG: +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   HG: @@ -0,0 +1,1 @@
diff --git a/tests/test-conflict.t b/tests/test-conflict.t
--- a/tests/test-conflict.t
+++ b/tests/test-conflict.t
@@ -49,13 +49,13 @@ 
   1
   2
   3
-  <<<<<<< local: 618808747361 - test: branch2
+  <<<<<<< working copy: 618808747361 - test: branch2
   6
   8
   =======
   4
   5
-  >>>>>>> other: c0c68e4fe667  - test: branch1
+  >>>>>>> merge rev:    c0c68e4fe667  - test: branch1
   Hop we are done.
 
   $ hg status
@@ -79,13 +79,13 @@ 
   1
   2
   3
-  <<<<<<< local: test 2
+  <<<<<<< working copy: test 2
   6
   8
   =======
   4
   5
-  >>>>>>> other: test 1
+  >>>>>>> merge rev:    test 1
   Hop we are done.
 
 Verify line splitting of custom conflict marker which causes multiple lines
@@ -105,13 +105,13 @@ 
   1
   2
   3
-  <<<<<<< local: test 2
+  <<<<<<< working copy: test 2
   6
   8
   =======
   4
   5
-  >>>>>>> other: test 1
+  >>>>>>> merge rev:    test 1
   Hop we are done.
 
 Verify line trimming of custom conflict marker using multi-byte characters
@@ -144,13 +144,13 @@ 
   1
   2
   3
-  <<<<<<< local: 123456789012345678901234567890123456789012345678901234567890\xe3\x81\x82... (esc)
+  <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345...
   6
   8
   =======
   4
   5
-  >>>>>>> other: branch1
+  >>>>>>> merge rev:    branch1
   Hop we are done.
 
 Verify basic conflict markers
@@ -170,13 +170,13 @@ 
   1
   2
   3
-  <<<<<<< local
+  <<<<<<< working copy
   6
   8
   =======
   4
   5
-  >>>>>>> other
+  >>>>>>> merge rev
   Hop we are done.
 
 internal:merge3
@@ -191,7 +191,7 @@ 
   [1]
   $ cat a
   Small Mathematical Series.
-  <<<<<<< local
+  <<<<<<< working copy
   1
   2
   3
@@ -209,7 +209,7 @@ 
   3
   4
   5
-  >>>>>>> other
+  >>>>>>> merge rev
   Hop we are done.
 
 Add some unconflicting changes on each head, to make sure we really
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -1113,11 +1113,11 @@ 
   [1]
   $ cat m
   $Id$
-  <<<<<<< local: 88a80c8d172e - test: 8bar
+  <<<<<<< working copy: 88a80c8d172e - test: 8bar
   bar
   =======
   foo
-  >>>>>>> other: 85d2d2d732a5  - test: simplemerge
+  >>>>>>> merge rev:    85d2d2d732a5  - test: simplemerge
 
 resolve to local, m must contain hash of last change (local parent)
 
diff --git a/tests/test-merge-changedelete.t b/tests/test-merge-changedelete.t
--- a/tests/test-merge-changedelete.t
+++ b/tests/test-merge-changedelete.t
@@ -54,9 +54,9 @@ 
 Non-interactive merge:
 
   $ hg merge -y
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging file3
   warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
@@ -77,6 +77,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -100,11 +103,11 @@ 
   changed
   --- file3 ---
   3
-  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
   changed2
   =======
   changed1
-  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
+  >>>>>>> merge rev:    10f9a0a634e8  - test: removed file1, changed file2, cha...
 
 
 Interactive merge:
@@ -117,9 +120,9 @@ 
   > c
   > d
   > EOF
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? c
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
   merging file3
   warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
@@ -140,6 +143,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -161,11 +167,11 @@ 
   *** file2 does not exist
   --- file3 ---
   3
-  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
   changed2
   =======
   changed1
-  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
+  >>>>>>> merge rev:    10f9a0a634e8  - test: removed file1, changed file2, cha...
 
 
 Interactive merge with bad input:
@@ -181,18 +187,18 @@ 
   > baz
   > c
   > EOF
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? foo
   unrecognized response
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? bar
   unrecognized response
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? d
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? baz
   unrecognized response
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
   merging file3
   warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
@@ -213,6 +219,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -234,11 +243,11 @@ 
   changed
   --- file3 ---
   3
-  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
   changed2
   =======
   changed1
-  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
+  >>>>>>> merge rev:    10f9a0a634e8  - test: removed file1, changed file2, cha...
 
 
 Interactive merge with not enough input:
@@ -250,9 +259,9 @@ 
   $ hg merge --config ui.interactive=true <<EOF
   > d
   > EOF
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? d
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? 
   merging file3
   warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
@@ -273,6 +282,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -294,11 +306,11 @@ 
   changed
   --- file3 ---
   3
-  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
   changed2
   =======
   changed1
-  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
+  >>>>>>> merge rev:    10f9a0a634e8  - test: removed file1, changed file2, cha...
 
 Choose local versions of files
 
@@ -322,6 +334,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -367,6 +382,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -413,6 +431,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -445,12 +466,12 @@ 
   1 other heads for branch "default"
 
   $ hg merge --config ui.interactive=True --tool :prompt
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? 
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? 
   no tool found to merge file3
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? 
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? 
   0 files updated, 0 files merged, 0 files removed, 3 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
@@ -467,6 +488,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -501,12 +525,12 @@ 
   1 other heads for branch "default"
 
   $ hg merge --tool :prompt
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   no tool found to merge file3
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? u
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? u
   0 files updated, 0 files merged, 0 files removed, 3 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
@@ -523,6 +547,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -555,9 +582,9 @@ 
   1 other heads for branch "default"
 
   $ hg merge --tool :merge3
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging file3
   warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
@@ -577,6 +604,9 @@ 
   * version 2 records
   local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
   other: 10f9a0a634e82080907e62f075ab119cbc565ea6
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
   file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")
@@ -600,12 +630,12 @@ 
   changed
   --- file3 ---
   3
-  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
   changed2
   ||||||| base
   =======
   changed1
-  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
+  >>>>>>> merge rev:    10f9a0a634e8  - test: removed file1, changed file2, cha...
 
 Exercise transitions between local, other, fail and prompt, and make sure the
 dirstate stays consistent. (Compare with each other and to the above
@@ -642,12 +672,12 @@ 
   (status identical)
   
   === :other -> :prompt ===
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? 
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? 
   no tool found to merge file3
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? 
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? 
   --- diff of status ---
   (status identical)
   
@@ -671,12 +701,12 @@ 
   (status identical)
   
   === :local -> :prompt ===
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? 
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? 
   no tool found to merge file3
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? 
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? 
   --- diff of status ---
   (status identical)
   
@@ -690,12 +720,12 @@ 
   (status identical)
   
   === :fail -> :prompt ===
-  local changed file1 which other deleted
+  local [working copy] changed file1 which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? 
-  other changed file2 which local deleted
+  other [merge rev] changed file2 which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? 
   no tool found to merge file3
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? 
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? 
   --- diff of status ---
   (status identical)
   
diff --git a/tests/test-merge-force.t b/tests/test-merge-force.t
--- a/tests/test-merge-force.t
+++ b/tests/test-merge-force.t
@@ -142,55 +142,55 @@ 
 #   in the same way, so it could potentially be left alone
 
   $ hg merge -f --tool internal:merge3 'desc("remote")' 2>&1 | tee $TESTTMP/merge-output-1
-  local changed content1_missing_content1_content4-tracked which other deleted
-  use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  local changed content1_missing_content3_content3-tracked which other deleted
-  use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  local changed content1_missing_content3_content4-tracked which other deleted
-  use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  local changed content1_missing_missing_content4-tracked which other deleted
+  local [working copy] changed content1_missing_content1_content4-tracked which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  other changed content1_content2_content1_content1-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content1_content2-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content1_content4-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content1_missing-tracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content1_missing-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_content1-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_content2-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_content4-untracked which local deleted
+  local [working copy] changed content1_missing_content3_content3-tracked which other [merge rev] deleted
+  use (c)hanged version, (d)elete, or leave (u)nresolved? u
+  local [working copy] changed content1_missing_content3_content4-tracked which other [merge rev] deleted
+  use (c)hanged version, (d)elete, or leave (u)nresolved? u
+  local [working copy] changed content1_missing_missing_content4-tracked which other [merge rev] deleted
+  use (c)hanged version, (d)elete, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content1_content1-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_missing-tracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_missing-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_content1-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_content2-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_content3-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_content4-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_content2-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_missing-tracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_missing-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_content1-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_content4-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_content2-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_missing-tracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_content4-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_missing-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_missing-tracked which local deleted
+  other [merge rev] changed content1_content2_content2_content1-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_missing-untracked which local deleted
+  other [merge rev] changed content1_content2_content2_content2-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content2_content4-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content2_missing-tracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content2_missing-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content3_content1-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content3_content2-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content3_content3-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content3_content4-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content3_missing-tracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_content3_missing-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_missing_content1-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_missing_content2-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_missing_content4-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_missing_missing-tracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_missing_missing-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_content1_content4-tracked
   merging content1_content2_content2_content1-tracked
@@ -373,13 +373,13 @@ 
   content2
   
   M content1_content2_content1_content4-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   content1
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M content1_content2_content1_content4-untracked
   content2
@@ -403,13 +403,13 @@ 
   content2
   
   M content1_content2_content2_content4-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   content1
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M content1_content2_content2_content4-untracked
   content2
@@ -433,25 +433,25 @@ 
   content2
   
   M content1_content2_content3_content3-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content3
   ||||||| base
   content1
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M content1_content2_content3_content3-untracked
   content2
   
   M content1_content2_content3_content4-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   content1
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M content1_content2_content3_content4-untracked
   content2
@@ -475,13 +475,13 @@ 
   content2
   
   M content1_content2_missing_content4-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   content1
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M content1_content2_missing_content4-untracked
   content2
@@ -559,12 +559,12 @@ 
   content2
   
   M missing_content2_content2_content4-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M missing_content2_content2_content4-untracked
   content2
@@ -582,23 +582,23 @@ 
   content2
   
   M missing_content2_content3_content3-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content3
   ||||||| base
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M missing_content2_content3_content3-untracked
   content2
   
   M missing_content2_content3_content4-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M missing_content2_content3_content4-untracked
   content2
@@ -616,20 +616,20 @@ 
   content2
   
   M missing_content2_missing_content4-tracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M missing_content2_missing_content4-untracked
-  <<<<<<< local: 0447570f1af6 - test: local
+  <<<<<<< working copy: 0447570f1af6 - test: local
   content4
   ||||||| base
   =======
   content2
-  >>>>>>> other: 85100b8c675b  - test: remote
+  >>>>>>> merge rev:    85100b8c675b  - test: remote
   
   M missing_content2_missing_missing-tracked
   content2
@@ -703,63 +703,63 @@ 
   (no more unresolved files)
   $ hg resolve --unmark --all
   $ hg resolve --all --tool internal:merge3
-  other changed content1_content2_content1_content1-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_content1-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content1_content2-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_content2-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_content1_content4-tracked
-  other changed content1_content2_content1_content4-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_content4-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content1_missing-tracked which local deleted
+  other [merge rev] changed content1_content2_content1_missing-tracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content1_missing-untracked which local deleted
+  other [merge rev] changed content1_content2_content1_missing-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_content2_content1-tracked
-  other changed content1_content2_content2_content1-untracked which local deleted
+  other [merge rev] changed content1_content2_content2_content1-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_content2-untracked which local deleted
+  other [merge rev] changed content1_content2_content2_content2-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_content2_content4-tracked
-  other changed content1_content2_content2_content4-untracked which local deleted
+  other [merge rev] changed content1_content2_content2_content4-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_missing-tracked which local deleted
+  other [merge rev] changed content1_content2_content2_missing-tracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content2_missing-untracked which local deleted
+  other [merge rev] changed content1_content2_content2_missing-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_content3_content1-tracked
-  other changed content1_content2_content3_content1-untracked which local deleted
+  other [merge rev] changed content1_content2_content3_content1-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_content2-untracked which local deleted
+  other [merge rev] changed content1_content2_content3_content2-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_content3_content3-tracked
-  other changed content1_content2_content3_content3-untracked which local deleted
+  other [merge rev] changed content1_content2_content3_content3-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_content3_content4-tracked
-  other changed content1_content2_content3_content4-untracked which local deleted
+  other [merge rev] changed content1_content2_content3_content4-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_missing-tracked which local deleted
+  other [merge rev] changed content1_content2_content3_missing-tracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_content3_missing-untracked which local deleted
+  other [merge rev] changed content1_content2_content3_missing-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_missing_content1-tracked
-  other changed content1_content2_missing_content1-untracked which local deleted
+  other [merge rev] changed content1_content2_missing_content1-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_content2-untracked which local deleted
+  other [merge rev] changed content1_content2_missing_content2-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging content1_content2_missing_content4-tracked
-  other changed content1_content2_missing_content4-untracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_missing-tracked which local deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  other changed content1_content2_missing_missing-untracked which local deleted
+  other [merge rev] changed content1_content2_missing_content4-untracked which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  local changed content1_missing_content1_content4-tracked which other deleted
+  other [merge rev] changed content1_content2_missing_missing-tracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  other [merge rev] changed content1_content2_missing_missing-untracked which local [working copy] deleted
+  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  local [working copy] changed content1_missing_content1_content4-tracked which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  local changed content1_missing_content3_content3-tracked which other deleted
+  local [working copy] changed content1_missing_content3_content3-tracked which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  local changed content1_missing_content3_content4-tracked which other deleted
+  local [working copy] changed content1_missing_content3_content4-tracked which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
-  local changed content1_missing_missing_content4-tracked which other deleted
+  local [working copy] changed content1_missing_missing_content4-tracked which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
   merging missing_content2_content2_content4-tracked
   merging missing_content2_content3_content3-tracked
diff --git a/tests/test-merge-remove.t b/tests/test-merge-remove.t
--- a/tests/test-merge-remove.t
+++ b/tests/test-merge-remove.t
@@ -102,7 +102,7 @@ 
 Those who use force will lose
 
   $ hg merge -f
-  other changed bar which local deleted
+  other [merge rev] changed bar which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
   merging foo1 and foo to foo1
   0 files updated, 1 files merged, 0 files removed, 1 files unresolved
diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -75,11 +75,11 @@ 
   [1]
   $ aftermerge
   # cat f
-  <<<<<<< local: ef83787e2614  - test: revision 1
+  <<<<<<< working copy: ef83787e2614  - test: revision 1
   revision 1
   =======
   revision 2
-  >>>>>>> other: 0185f4e0cf02  - test: revision 2
+  >>>>>>> merge rev:    0185f4e0cf02  - test: revision 2
   space
   # hg stat
   M f
@@ -532,7 +532,7 @@ 
   # hg update -C 1
   $ hg merge -r 2 --config ui.merge=internal:prompt
   no tool found to merge f
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? u
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? u
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
@@ -557,7 +557,7 @@ 
   > u
   > EOF
   no tool found to merge f
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? u
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? u
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
@@ -580,7 +580,7 @@ 
   # hg update -C 1
   $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
   no tool found to merge f
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? 
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? 
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
@@ -594,7 +594,7 @@ 
   U f
   $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
   no tool found to merge f
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? 
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? 
   [1]
   $ aftermerge
   # cat f
@@ -608,7 +608,7 @@ 
   $ rm f
   $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
   no tool found to merge f
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? 
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? 
   [1]
   $ aftermerge
   # cat f
@@ -620,7 +620,7 @@ 
   U f
   $ hg resolve --all --config ui.merge=internal:prompt
   no tool found to merge f
-  keep (l)ocal, take (o)ther, or leave (u)nresolved? u
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved? u
   [1]
   $ aftermerge
   # cat f
@@ -935,12 +935,12 @@ 
   # hg update -C 1
   $ hg merge -r 4 --config merge-tools.true.premerge=keep
   merging f
-  <<<<<<< local: ef83787e2614  - test: revision 1
+  <<<<<<< working copy: ef83787e2614  - test: revision 1
   revision 1
   space
   =======
   revision 4
-  >>>>>>> other: 81448d39c9a0 - test: revision 4
+  >>>>>>> merge rev:    81448d39c9a0 - test: revision 4
   revision 0
   space
   revision 4
@@ -948,12 +948,12 @@ 
   (branch merge, don't forget to commit)
   $ aftermerge
   # cat f
-  <<<<<<< local: ef83787e2614  - test: revision 1
+  <<<<<<< working copy: ef83787e2614  - test: revision 1
   revision 1
   space
   =======
   revision 4
-  >>>>>>> other: 81448d39c9a0 - test: revision 4
+  >>>>>>> merge rev:    81448d39c9a0 - test: revision 4
   # hg stat
   M f
   # hg resolve --list
@@ -969,7 +969,7 @@ 
   # hg update -C 1
   $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
   merging f
-  <<<<<<< local: ef83787e2614  - test: revision 1
+  <<<<<<< working copy: ef83787e2614  - test: revision 1
   revision 1
   space
   ||||||| base
@@ -977,7 +977,7 @@ 
   space
   =======
   revision 4
-  >>>>>>> other: 81448d39c9a0 - test: revision 4
+  >>>>>>> merge rev:    81448d39c9a0 - test: revision 4
   revision 0
   space
   revision 4
@@ -985,7 +985,7 @@ 
   (branch merge, don't forget to commit)
   $ aftermerge
   # cat f
-  <<<<<<< local: ef83787e2614  - test: revision 1
+  <<<<<<< working copy: ef83787e2614  - test: revision 1
   revision 1
   space
   ||||||| base
@@ -993,7 +993,7 @@ 
   space
   =======
   revision 4
-  >>>>>>> other: 81448d39c9a0 - test: revision 4
+  >>>>>>> merge rev:    81448d39c9a0 - test: revision 4
   # hg stat
   M f
   # hg resolve --list
diff --git a/tests/test-merge-types.t b/tests/test-merge-types.t
--- a/tests/test-merge-types.t
+++ b/tests/test-merge-types.t
@@ -356,18 +356,18 @@ 
   U h
   $ tellmeabout a
   a is a plain file with content:
-  <<<<<<< local: 0139c5610547 - test: 2
+  <<<<<<< working copy: 0139c5610547 - test: 2
   2
   =======
   1
-  >>>>>>> other: 97e29675e796  - test: 1
+  >>>>>>> merge rev:    97e29675e796  - test: 1
   $ tellmeabout b
   b is a plain file with content:
-  <<<<<<< local: 0139c5610547 - test: 2
+  <<<<<<< working copy: 0139c5610547 - test: 2
   2
   =======
   1
-  >>>>>>> other: 97e29675e796  - test: 1
+  >>>>>>> merge rev:    97e29675e796  - test: 1
   $ tellmeabout c
   c is a plain file with content:
   x
@@ -409,18 +409,18 @@ 
   [1]
   $ tellmeabout a
   a is a plain file with content:
-  <<<<<<< local: 97e29675e796  - test: 1
+  <<<<<<< working copy: 97e29675e796  - test: 1
   1
   =======
   2
-  >>>>>>> other: 0139c5610547 - test: 2
+  >>>>>>> merge rev:    0139c5610547 - test: 2
   $ tellmeabout b
   b is an executable file with content:
-  <<<<<<< local: 97e29675e796  - test: 1
+  <<<<<<< working copy: 97e29675e796  - test: 1
   1
   =======
   2
-  >>>>>>> other: 0139c5610547 - test: 2
+  >>>>>>> merge rev:    0139c5610547 - test: 2
   $ tellmeabout c
   c is an executable file with content:
   x
diff --git a/tests/test-merge7.t b/tests/test-merge7.t
--- a/tests/test-merge7.t
+++ b/tests/test-merge7.t
@@ -99,11 +99,11 @@ 
 
   $ cat test.txt
   one
-  <<<<<<< local: 50c3a7e29886  - test: Merge 1
+  <<<<<<< working copy: 50c3a7e29886  - test: Merge 1
   two-point-five
   =======
   two-point-one
-  >>>>>>> other: 40d11a4173a8 - test: two -> two-point-one
+  >>>>>>> merge rev:    40d11a4173a8 - test: two -> two-point-one
   three
 
   $ hg debugindex test.txt
diff --git a/tests/test-rename-dir-merge.t b/tests/test-rename-dir-merge.t
--- a/tests/test-rename-dir-merge.t
+++ b/tests/test-rename-dir-merge.t
@@ -144,11 +144,11 @@ 
   C b/a
   C b/b
   $ cat b/c
-  <<<<<<< local: f1c50ca4f127 - test: new file in target directory
+  <<<<<<< working copy: f1c50ca4f127 - test: new file in target directory
   target
   =======
   baz
-  >>>>>>> other: ce36d17b18fb  - test: 2 add a/c
+  >>>>>>> merge rev:    ce36d17b18fb  - test: 2 add a/c
   $ rm b/c.orig
 
 Remote directory rename with conflicting file added in remote target directory
@@ -177,11 +177,11 @@ 
   ? a/d
   ? b/c.orig
   $ cat b/c
-  <<<<<<< local: ce36d17b18fb  - test: 2 add a/c
+  <<<<<<< working copy: ce36d17b18fb  - test: 2 add a/c
   baz
   =======
   target
-  >>>>>>> other: f1c50ca4f127 - test: new file in target directory
+  >>>>>>> merge rev:    f1c50ca4f127 - test: new file in target directory
 
 Second scenario with two repos:
 
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -694,7 +694,7 @@ 
   starting 4 threads for background file closing (?)
    a: prompt deleted/changed -> m (premerge)
   picked tool ':prompt' for a (binary False symlink False changedelete True)
-  other changed a which local deleted
+  other [merge rev] changed a which local [working copy] deleted
   use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
    b: both created -> m (premerge)
   picked tool 'python ../merge' for b (binary False symlink False changedelete False)
@@ -739,7 +739,7 @@ 
   starting 4 threads for background file closing (?)
    a: prompt changed/deleted -> m (premerge)
   picked tool ':prompt' for a (binary False symlink False changedelete True)
-  local changed a which other deleted
+  local [working copy] changed a which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? u
    b: both created -> m (premerge)
   picked tool 'python ../merge' for b (binary False symlink False changedelete False)
diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -290,6 +290,9 @@ 
   * version 2 records
   local: 57653b9f834a4493f7240b0681efcb9ae7cab745
   other: dc77451844e37f03f5c559e3b8529b2b48d381d1
+  labels:
+    local: working copy
+    other: merge rev
   unrecognized entry: x	advisory record
   file extras: file1 (ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac)
   file: file1 (record type "F", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
@@ -312,6 +315,9 @@ 
   * version 2 records
   local: 57653b9f834a4493f7240b0681efcb9ae7cab745
   other: dc77451844e37f03f5c559e3b8529b2b48d381d1
+  labels:
+    local: working copy
+    other: merge rev
   file extras: file1 (ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac)
   file: file1 (record type "F", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
     local path: file1 (flags "")