[PATCH] merge: when --tool is specified, disable HGMERGE by setting to empty string

Steve Borho steve at borho.org
Mon Oct 18 23:20:23 CDT 2010


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1287462014 18000
# Node ID 096444ceebdf61e58466ad1c85bbca1019fab76b
# Parent  ef5eaf53f4f73ee1e225f5c524cb51ed1e7bb973
merge: when --tool is specified, disable HGMERGE by setting to empty string

HGMERGE has different semantics than ui.merge.  HGMERGE should hold the name
on an executable in your path, or an absolute tool path.  As such, it's not
safe to simply copy the user's specified --tool value into HGMERGE.  Instead,
we disable HGMERGE by setting it to an empty string.

diff -r ef5eaf53f4f7 -r 096444ceebdf mercurial/commands.py
--- a/mercurial/commands.py	Tue Oct 19 03:56:20 2010 +0200
+++ b/mercurial/commands.py	Mon Oct 18 23:20:14 2010 -0500
@@ -2589,7 +2589,7 @@
     t = opts.get('tool')
     if t:
         if 'HGMERGE' in os.environ:
-            os.environ['HGMERGE'] = t
+            os.environ['HGMERGE'] = ''
         ui.setconfig('ui', 'merge', t)
 
     if not node:
@@ -2982,7 +2982,7 @@
     t = opts.get('tool')
     if t:
         if 'HGMERGE' in os.environ:
-            os.environ['HGMERGE'] = t
+            os.environ['HGMERGE'] = ''
         ui.setconfig('ui', 'merge', t)
 
     ms = mergemod.mergestate(repo)


More information about the Mercurial-devel mailing list