Comment 13 for bug 939605

Revision history for this message
Alexander Belchenko (bialix) wrote :

I think the following change should make check_availability to return True:

=== modified file 'bzrlib/mergetools.py'
--- bzrlib/mergetools.py 2011-12-19 13:23:58 +0000
+++ bzrlib/mergetools.py 2012-02-23 17:08:49 +0000
@@ -30,6 +30,7 @@
     cmdline,
     osutils,
     trace,
+ win32utils,
 )
 """)

@@ -54,7 +55,11 @@
                         for s in os.getenv('PATHEXT', '').split(os.pathsep)]
             return os.path.exists(exe) and ext in path_ext
         else:
- return osutils.find_executable_on_path(exe) is not None
+ if osutils.find_executable_on_path(exe) is not None:
+ return True
+ if win32utils.get_app_path(exe) != exe:
+ return True
+ return False
     else:
         return (os.access(exe, os.X_OK)
                 or osutils.find_executable_on_path(exe) is not None)

But the real tool invoker should convert program name to its fullpath on Windows, otherwise python will be unable to launch the program, unless you will pass "shell=True" to subprocess.Popen