Patchwork [evolve_ext] evolve: add --tool option so we don't have to use HGMERGE

login
register
mail settings
Submitter Greg Ward
Date June 23, 2014, 12:10 a.m.
Message ID <573097d5ccbdf75175e0.1403482217@lucifer.gerg.ca>
Download mbox | patch
Permalink /patch/5042/
State Accepted
Headers show

Comments

Greg Ward - June 23, 2014, 12:10 a.m.
# HG changeset patch
# User Greg Ward <greg@gerg.ca>
# Date 1403482207 14400
#      Sun Jun 22 20:10:07 2014 -0400
# Node ID 573097d5ccbdf75175e077a22576e0dfaa4a65da
# Parent  4ab7a80fc11f275c03d4ddb94936a0688b71e6bc
evolve: add --tool option so we don't have to use HGMERGE
Pierre-Yves David - June 23, 2014, 9:08 a.m.
On 06/22/2014 05:10 PM, Greg Ward wrote:
> # HG changeset patch
> # User Greg Ward <greg@gerg.ca>
> # Date 1403482207 14400
> #      Sun Jun 22 20:10:07 2014 -0400
> # Node ID 573097d5ccbdf75175e077a22576e0dfaa4a65da
> # Parent  4ab7a80fc11f275c03d4ddb94936a0688b71e6bc
> evolve: add --tool option so we don't have to use HGMERGE

Pushed after a README update.

>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -62,7 +62,7 @@
>   from mercurial import scmutil
>   from mercurial import templatekw
>   from mercurial.i18n import _
> -from mercurial.commands import walkopts, commitopts, commitopts2
> +from mercurial.commands import walkopts, commitopts, commitopts2, mergetoolopts
>   from mercurial.node import nullid
>   from mercurial import wireproto
>   from mercurial import localrepo
> @@ -1151,7 +1151,8 @@
>           'do not perform actions, just print what would be done'),
>       ('A', 'any', False, 'evolve any troubled changeset'),
>       ('a', 'all', False, 'evolve all troubled changesets'),
> -    ('c', 'continue', False, 'continue an interrupted evolution'), ],
> +    ('c', 'continue', False, 'continue an interrupted evolution'),
> +    ] + mergetoolopts,
>       _('[OPTIONS]...'))
>   def evolve(ui, repo, **opts):
>       """Solve trouble in your repository
> @@ -1181,6 +1182,7 @@
>       anyopt = opts['any']
>       allopt = opts['all']
>       dryrunopt = opts['dry_run']
> +    ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'evolve')
>
>       if contopt:
>           if anyopt:
> diff --git a/tests/test-sharing.t b/tests/test-sharing.t
> --- a/tests/test-sharing.t
> +++ b/tests/test-sharing.t
> @@ -271,7 +271,7 @@
>     o  0:0dc9c9f6ab91  public  create new project
>
>   Merge the trouble away.
> -  $ HGMERGE=internal:local hg merge
> +  $ hg merge --tool internal:local
>     0 files updated, 1 files merged, 0 files removed, 0 files unresolved
>     (branch merge, don't forget to commit)
>     $ hg commit -m merge
> @@ -294,7 +294,7 @@
>
>   # XXX hg evolve does not solve this trouble! bug in evolve?
>   #Evolve the trouble away.
> -#  $ HGMERGE=internal:local hg evolve --all
> +#  $ hg evolve --all --tool=internal:local
>   #  merge:[5] fix bug 24 (v2 by bob)
>   #  with: [6] fix bug 24 (v2 by alice)
>   #  base: [3] fix bug 24 (v1)
> diff --git a/tests/test-stabilize-conflict.t b/tests/test-stabilize-conflict.t
> --- a/tests/test-stabilize-conflict.t
> +++ b/tests/test-stabilize-conflict.t
> @@ -209,7 +209,7 @@
>     $ hg amend
>     1 new unstable changesets
>     $ safesed 's/interactive=.*/interactive=true/' $HGRCPATH
> -  $ HGMERGE=touch hg evolve <<EOF
> +  $ hg evolve --tool touch <<EOF
>     > n
>     > EOF
>     move:[8] babar count up to fifteen
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -62,7 +62,7 @@ 
 from mercurial import scmutil
 from mercurial import templatekw
 from mercurial.i18n import _
-from mercurial.commands import walkopts, commitopts, commitopts2
+from mercurial.commands import walkopts, commitopts, commitopts2, mergetoolopts
 from mercurial.node import nullid
 from mercurial import wireproto
 from mercurial import localrepo
@@ -1151,7 +1151,8 @@ 
         'do not perform actions, just print what would be done'),
     ('A', 'any', False, 'evolve any troubled changeset'),
     ('a', 'all', False, 'evolve all troubled changesets'),
-    ('c', 'continue', False, 'continue an interrupted evolution'), ],
+    ('c', 'continue', False, 'continue an interrupted evolution'),
+    ] + mergetoolopts,
     _('[OPTIONS]...'))
 def evolve(ui, repo, **opts):
     """Solve trouble in your repository
@@ -1181,6 +1182,7 @@ 
     anyopt = opts['any']
     allopt = opts['all']
     dryrunopt = opts['dry_run']
+    ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'evolve')
 
     if contopt:
         if anyopt:
diff --git a/tests/test-sharing.t b/tests/test-sharing.t
--- a/tests/test-sharing.t
+++ b/tests/test-sharing.t
@@ -271,7 +271,7 @@ 
   o  0:0dc9c9f6ab91  public  create new project
   
 Merge the trouble away.
-  $ HGMERGE=internal:local hg merge
+  $ hg merge --tool internal:local
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ hg commit -m merge
@@ -294,7 +294,7 @@ 
 
 # XXX hg evolve does not solve this trouble! bug in evolve?
 #Evolve the trouble away.
-#  $ HGMERGE=internal:local hg evolve --all
+#  $ hg evolve --all --tool=internal:local
 #  merge:[5] fix bug 24 (v2 by bob)
 #  with: [6] fix bug 24 (v2 by alice)
 #  base: [3] fix bug 24 (v1)
diff --git a/tests/test-stabilize-conflict.t b/tests/test-stabilize-conflict.t
--- a/tests/test-stabilize-conflict.t
+++ b/tests/test-stabilize-conflict.t
@@ -209,7 +209,7 @@ 
   $ hg amend
   1 new unstable changesets
   $ safesed 's/interactive=.*/interactive=true/' $HGRCPATH
-  $ HGMERGE=touch hg evolve <<EOF
+  $ hg evolve --tool touch <<EOF
   > n
   > EOF
   move:[8] babar count up to fifteen