Patchwork [4,of,5,V2] update: specify custom conflict markers for update

login
register
mail settings
Submitter Durham Goode
Date May 10, 2014, 2:48 a.m.
Message ID <bb5c619d1dc646da7810.1399690091@dev2000.prn2.facebook.com>
Download mbox | patch
Permalink /patch/4701/
State Accepted
Headers show

Comments

Durham Goode - May 10, 2014, 2:48 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1399684151 25200
#      Fri May 09 18:09:11 2014 -0700
# Node ID bb5c619d1dc646da78108bb7a959647e3428e6ab
# Parent  bb42f0b255a6cbe2128ca0cb6cee7b238d932389
update: specify custom conflict markers for update

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

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -483,7 +483,10 @@ 
     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: c3fa  test - "added file1 and file2"
+  +<<<<<<< working copy: c3fa  test - "added file1 and file2"
   +changed file1 different
   +=======
    changed file1
-  +>>>>>>> other: dfab  test - "changed file1"
+  +>>>>>>> destination:  dfab  test - "changed file1"
 
   $ hg status
   M file1