eric7/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py

branch
eric7
changeset 9054
adae534abaf0
parent 8881
54e42bc2437a
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py	Wed May 04 14:43:25 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py	Thu May 05 17:40:52 2022 +0200
@@ -24,19 +24,22 @@
     @return path of the Mercurial executable
     @rtype str
     """
-    exe = ""
-    program = "hg"
-    if isWindowsPlatform():
-        program += ".exe"
-        dirName = os.path.dirname(sys.executable)
-        if os.path.exists(os.path.join(dirName, program)):
-            exe = os.path.join(dirName, program)
-        elif os.path.exists(os.path.join(dirName, "Scripts", program)):
-            exe = os.path.join(dirName, "Scripts", program)
-    else:
-        dirName = os.path.dirname(sys.executable)
-        if os.path.exists(os.path.join(dirName, program)):
-            exe = os.path.join(dirName, program)
+    from Plugins.PluginVcsMercurial import VcsMercurialPlugin
+    
+    exe = VcsMercurialPlugin.getPreferences("MercurialExecutablePath")
+    if not exe:
+        program = "hg"
+        if isWindowsPlatform():
+            program += ".exe"
+            dirName = os.path.dirname(sys.executable)
+            if os.path.exists(os.path.join(dirName, program)):
+                exe = os.path.join(dirName, program)
+            elif os.path.exists(os.path.join(dirName, "Scripts", program)):
+                exe = os.path.join(dirName, "Scripts", program)
+        else:
+            dirName = os.path.dirname(sys.executable)
+            if os.path.exists(os.path.join(dirName, program)):
+                exe = os.path.join(dirName, program)
     
     if not exe:
         exe = program

eric ide

mercurial