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

Greg Ward greg at gerg.ca
Sun Jun 22 19:10:17 CDT 2014


# HG changeset patch
# User Greg Ward <greg at 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

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


More information about the Mercurial-devel mailing list