merge: when --tool is specified, disable HGMERGE by setting to empty string
authorSteve Borho <steve@borho.org>
Mon, 18 Oct 2010 23:20:14 -0500
changeset 12765 5eed9ceebd64
parent 12764 ad2506f097d3
child 12766 21a50fe47a92
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.
mercurial/commands.py
--- a/mercurial/commands.py	Mon Oct 18 14:10:36 2010 +0900
+++ 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)