diff mercurial/scmwindows.py @ 32248:d74b0cff94a9

osutil: proxy through util (and platform) modules (API) See the previous commit for why. Marked as API change since osutil.listdir() seems widely used in third-party extensions. The win32mbcs extension is updated to wrap both util. and windows. aliases.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 26 Apr 2017 22:26:28 +0900
parents bf5e13e38390
children e24802ea8dbd
line wrap: on
line diff
--- a/mercurial/scmwindows.py	Wed Apr 26 22:05:59 2017 +0900
+++ b/mercurial/scmwindows.py	Wed Apr 26 22:26:28 2017 +0900
@@ -4,7 +4,6 @@
 
 from . import (
     encoding,
-    osutil,
     pycompat,
     util,
     win32,
@@ -29,7 +28,7 @@
     # Use hgrc.d found in directory with hg.exe
     progrcd = os.path.join(os.path.dirname(filename), 'hgrc.d')
     if os.path.isdir(progrcd):
-        for f, kind in osutil.listdir(progrcd):
+        for f, kind in util.listdir(progrcd):
             if f.endswith('.rc'):
                 rcpath.append(os.path.join(progrcd, f))
     # else look for a system rcpath in the registry
@@ -42,7 +41,7 @@
         if p.lower().endswith('mercurial.ini'):
             rcpath.append(p)
         elif os.path.isdir(p):
-            for f, kind in osutil.listdir(p):
+            for f, kind in util.listdir(p):
                 if f.endswith('.rc'):
                     rcpath.append(os.path.join(p, f))
     return rcpath