[PATCH 4 of 5 V3] update: specify custom conflict markers for update (BC)

Durham Goode durham at fb.com
Mon May 12 19:47:36 CDT 2014


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1399684151 25200
#      Fri May 09 18:09:11 2014 -0700
# Node ID 2ca6a41546b166ca491537d85729fc3e9c42c01b
# Parent  3e64ef576f5da47348903d25727d5e7c6c6a046a
update: specify custom conflict markers for update (BC)

Add custom conflict markers 'working copy' and 'destination' for doing hg update
when there are conflicts between your working copy and the destination.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -483,7 +483,8 @@
     When overwrite is set, changes are clobbered, merged else
 
     returns stats (see pydoc mercurial.merge.applyupdates)"""
-    return mergemod.update(repo, node, False, overwrite, None)
+    return mergemod.update(repo, node, False, overwrite, None,
+                           labels=['working copy', 'destination'])
 
 def update(repo, node):
     """update the working directory to node, merging linear changes"""
diff --git a/tests/test-merge-revert2.t b/tests/test-merge-revert2.t
--- a/tests/test-merge-revert2.t
+++ b/tests/test-merge-revert2.t
@@ -57,11 +57,11 @@
   @@ -1,3 +1,7 @@
    added file1
    another line of text
-  +<<<<<<< local: c3fa057dd86f  - test: "added file1 and file2"
+  +<<<<<<< working copy: c3fa057dd86f  - test: "added file1 and file2"
   +changed file1 different
   +=======
    changed file1
-  +>>>>>>> other: dfab7f3c2efb - test: "changed file1"
+  +>>>>>>> destination:  dfab7f3c2efb - test: "changed file1"
 
   $ hg status
   M file1


More information about the Mercurial-devel mailing list