[PATCH 1 of 1] extdiff: use absolute paths for any temporary files

Jason Harris jason.f.harris at gmail.com
Fri Mar 25 09:54:52 CDT 2011


# HG changeset patch
# User jfh <jason at jasonfharris.com>
# Date 1300723396 -3600
# Node ID 50f3abe40a2b6ba8d44e10761e43a552e836a1ea
# Parent  48d606d7192b6f8f4fc8071fccdc5a83843ab2d3
extdiff: use absolute paths for any temporary files

This allows the use of p4merge amongst possible other external tools.

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -187,14 +187,14 @@
         # Handle bogus modifies correctly by checking if the files exist
         if len(common) == 1:
             common_file = util.localpath(common.pop())
-            dir1a = os.path.join(dir1a, common_file)
+            dir1a = os.path.join(tmproot, dir1a, common_file)
             label1a = common_file + rev1a
-            if not os.path.isfile(os.path.join(tmproot, dir1a)):
+            if not os.path.isfile(dir1a):
                 dir1a = os.devnull
             if do3way:
-                dir1b = os.path.join(dir1b, common_file)
+                dir1b = os.path.join(tmproot, dir1b, common_file)
                 label1b = common_file + rev1b
-                if not os.path.isfile(os.path.join(tmproot, dir1b)):
+                if not os.path.isfile(dir1b):
                     dir1b = os.devnull
             dir2 = os.path.join(dir2root, dir2, common_file)
             label2 = common_file + rev2


More information about the Mercurial-devel mailing list