[PATCH 5 of 5] rebase: specify custom conflict marker labels for rebase

Durham Goode durham at fb.com
Thu May 8 19:33:30 CDT 2014


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1399593356 25200
#      Thu May 08 16:55:56 2014 -0700
# Node ID 375164d1425477d42f9d5c032465d79727648b17
# Parent  75ff3fc095cae6dcf513d424b7abb23121cc7e55
rebase: specify custom conflict marker labels for rebase

Changes rebase conflict markers to say 'source' and 'destination' instead of
'local' and 'other'.  This ends up looking like:

  one
  <<<<<<< destination: a3e5  master - "A commit to master"
  master
  =======
  mine
  >>>>>>> source: c7fd  - "A commit to my feature branch"
  three

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -533,7 +533,8 @@
         repo.ui.debug("   detach base %d:%s\n" % (repo[base].rev(), repo[base]))
     # When collapsing in-place, the parent is the common ancestor, we
     # have to allow merging with it.
-    return merge.update(repo, rev, True, True, False, base, collapse)
+    return merge.update(repo, rev, True, True, False, base, collapse,
+        labels=['destination', 'source'])
 
 def nearestrebased(repo, rev, state):
     """return the nearest ancestors of rev in the rebase result"""
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -210,11 +210,11 @@
   +++ b/a/a
   @@ -1,2 +1,6 @@
    a
-  +<<<<<<< local: *  - "pending changes temporary commit" (glob)
+  +<<<<<<< destination: *  - "pending changes temporary commit" (glob)
    c
   +=======
   +a
-  +>>>>>>> other: *  - "changes to '[mq]: second.patch'" (glob)
+  +>>>>>>> source: *  - "changes to '[mq]: second.patch'" (glob)
   diff --git a/b.rename/b b/b.rename/b
   new file mode 100644
   --- /dev/null
@@ -601,11 +601,11 @@
   M f
   ? f.orig
   $ cat f
-  <<<<<<< local: 5f6b  - "pending changes temporary commit"
+  <<<<<<< destination: 5f6b  - "pending changes temporary commit"
   g
   =======
   f
-  >>>>>>> other: 23b2  - "changes to 'commit stuff'"
+  >>>>>>> source: 23b2  - "changes to 'commit stuff'"
   $ cat f.orig
   g
   $ hg unshelve --abort
@@ -644,11 +644,11 @@
   M f
   ? f.orig
   $ cat f
-  <<<<<<< local: 6b56  - "intermediate other change"
+  <<<<<<< destination: 6b56  - "intermediate other change"
   g
   =======
   f
-  >>>>>>> other: 23b2  - "changes to 'commit stuff'"
+  >>>>>>> source: 23b2  - "changes to 'commit stuff'"
   $ cat f.orig
   g
   $ hg unshelve --abort


More information about the Mercurial-devel mailing list