[PATCH 1 of 5] rcutil: directly call win32.executablepath()

Yuya Nishihara yuya at tcha.org
Sat Mar 24 09:53:53 UTC 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1521865850 -32400
#      Sat Mar 24 13:30:50 2018 +0900
# Node ID 9bfb1ec8fb375630cfca0e42b17676e1892bd90a
# Parent  3f765e4cbf4c1e53e0fd88992c079b321749d837
rcutil: directly call win32.executablepath()

Since it isn't supported on POSIX platform, we don't need to double the
compatibility layers.

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -626,9 +626,6 @@ class cachestat(object):
     def __ne__(self, other):
         return not self == other
 
-def executablepath():
-    return None # available on Windows only
-
 def statislink(st):
     '''check whether a stat result is a symlink'''
     return st and stat.S_ISLNK(st.st_mode)
diff --git a/mercurial/scmwindows.py b/mercurial/scmwindows.py
--- a/mercurial/scmwindows.py
+++ b/mercurial/scmwindows.py
@@ -21,7 +21,7 @@ fallbackpager = 'more'
 def systemrcpath():
     '''return default os-specific hgrc search path'''
     rcpath = []
-    filename = util.executablepath()
+    filename = win32.executablepath()
     # Use mercurial.ini found in directory with hg.exe
     progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')
     rcpath.append(progrc)
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -108,7 +108,6 @@ cachestat = platform.cachestat
 checkexec = platform.checkexec
 checklink = platform.checklink
 copymode = platform.copymode
-executablepath = platform.executablepath
 expandglobs = platform.expandglobs
 explainexit = platform.explainexit
 findexe = platform.findexe
diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -31,7 +31,6 @@ except ImportError:
 
 osutil = policy.importmod(r'osutil')
 
-executablepath = win32.executablepath
 getfsmountpoint = win32.getvolumename
 getfstype = win32.getfstype
 getuser = win32.getuser


More information about the Mercurial-devel mailing list