Patchwork [3,of,5,V4] rebase: specify custom conflict marker labels for rebase (BC)

login
register
mail settings
Submitter Durham Goode
Date May 15, 2014, 8:52 p.m.
Message ID <e44dce239a97d58b20f3.1400187160@dev2000.prn2.facebook.com>
Download mbox | patch
Permalink /patch/4759/
State Superseded
Commit 3b40e32e88c34a29068328e68d645aa4b6648441
Headers show

Comments

Durham Goode - May 15, 2014, 8:52 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1399593356 25200
#      Thu May 08 16:55:56 2014 -0700
# Node ID e44dce239a97d58b20f35bec07c785e50c4d71c5
# Parent  b17c8f419ceeccd435a928508fbec4ceed09635e
rebase: specify custom conflict marker labels for rebase (BC)

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

  one
  <<<<<<< dest:   a3e5c7fd master - bob: "A commit to master"
  master
  =======
  mine
  >>>>>>> source: c7fda3e5 - durham: "A commit to my feature branch"
  three
Pierre-Yves David - May 16, 2014, 4:38 a.m.
On 05/15/2014 01:52 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1399593356 25200
> #      Thu May 08 16:55:56 2014 -0700
> # Node ID e44dce239a97d58b20f35bec07c785e50c4d71c5
> # Parent  b17c8f419ceeccd435a928508fbec4ceed09635e
> rebase: specify custom conflict marker labels for rebase (BC)

You told me you updated the documentation of the `merge-tools` section 
to reflect this, but I cannot find the update in your series.

> Changes rebase conflict markers to say 'source' and 'dest' instead of
> 'local' and 'other'.  This ends up looking like:
>
>    one
>    <<<<<<< dest:   a3e5c7fd master - bob: "A commit to master"
>    master
>    =======
>    mine
>    >>>>>>> source: c7fda3e5 - durham: "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=['dest', '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: *  - shelve: "pending changes temporary commit" (glob)
> +  +<<<<<<< dest: *  - shelve: "pending changes temporary commit" (glob)
>      c
>     +=======
>     +a
> -  +>>>>>>> other: * - shelve: "changes to '[mq]: second.patch'" (glob)
> +  +>>>>>>> source: * - shelve: "changes to '[mq]: second.patch'" (glob)
>     diff --git a/b.rename/b b/b.rename/b
>     new file mode 100644
>     --- /dev/null
> @@ -604,11 +604,11 @@
>     M f
>     ? f.orig
>     $ cat f
> -  <<<<<<< local: 5f6b880e719b  - shelve: "pending changes temporary commit"
> +  <<<<<<< dest:   5f6b880e719b  - shelve: "pending changes temporary commit"
>     g
>     =======
>     f
> -  >>>>>>> other: 23b29cada8ba - shelve: "changes to 'commit stuff'"
> +  >>>>>>> source: 23b29cada8ba - shelve: "changes to 'commit stuff'"
>     $ cat f.orig
>     g
>     $ hg unshelve --abort
> @@ -647,11 +647,11 @@
>     M f
>     ? f.orig
>     $ cat f
> -  <<<<<<< local: 6b563750f973  - test: "intermediate other change"
> +  <<<<<<< dest:   6b563750f973  - test: "intermediate other change"
>     g
>     =======
>     f
> -  >>>>>>> other: 23b29cada8ba - shelve: "changes to 'commit stuff'"
> +  >>>>>>> source: 23b29cada8ba - shelve: "changes to 'commit stuff'"
>     $ cat f.orig
>     g
>     $ hg unshelve --abort
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

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=['dest', '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: *  - shelve: "pending changes temporary commit" (glob)
+  +<<<<<<< dest: *  - shelve: "pending changes temporary commit" (glob)
    c
   +=======
   +a
-  +>>>>>>> other: * - shelve: "changes to '[mq]: second.patch'" (glob)
+  +>>>>>>> source: * - shelve: "changes to '[mq]: second.patch'" (glob)
   diff --git a/b.rename/b b/b.rename/b
   new file mode 100644
   --- /dev/null
@@ -604,11 +604,11 @@ 
   M f
   ? f.orig
   $ cat f
-  <<<<<<< local: 5f6b880e719b  - shelve: "pending changes temporary commit"
+  <<<<<<< dest:   5f6b880e719b  - shelve: "pending changes temporary commit"
   g
   =======
   f
-  >>>>>>> other: 23b29cada8ba - shelve: "changes to 'commit stuff'"
+  >>>>>>> source: 23b29cada8ba - shelve: "changes to 'commit stuff'"
   $ cat f.orig
   g
   $ hg unshelve --abort
@@ -647,11 +647,11 @@ 
   M f
   ? f.orig
   $ cat f
-  <<<<<<< local: 6b563750f973  - test: "intermediate other change"
+  <<<<<<< dest:   6b563750f973  - test: "intermediate other change"
   g
   =======
   f
-  >>>>>>> other: 23b29cada8ba - shelve: "changes to 'commit stuff'"
+  >>>>>>> source: 23b29cada8ba - shelve: "changes to 'commit stuff'"
   $ cat f.orig
   g
   $ hg unshelve --abort