mercurial/scmutil.py
changeset 31679 0f8ba0bc1154
parent 31553 56acc4250900
child 31951 f23d579a5a04
--- a/mercurial/scmutil.py	Sat Mar 25 17:25:23 2017 +0900
+++ b/mercurial/scmutil.py	Sun Mar 26 20:18:42 2017 -0700
@@ -20,7 +20,6 @@
     encoding,
     error,
     match as matchmod,
-    osutil,
     pathutil,
     phases,
     pycompat,
@@ -35,8 +34,6 @@
 else:
     from . import scmposix as scmplatform
 
-systemrcpath = scmplatform.systemrcpath
-userrcpath = scmplatform.userrcpath
 termsize = scmplatform.termsize
 
 class status(tuple):
@@ -391,45 +388,6 @@
                         newdirs.append(d)
             dirs[:] = newdirs
 
-def osrcpath():
-    '''return default os-specific hgrc search path'''
-    path = []
-    defaultpath = os.path.join(util.datapath, 'default.d')
-    if os.path.isdir(defaultpath):
-        for f, kind in osutil.listdir(defaultpath):
-            if f.endswith('.rc'):
-                path.append(os.path.join(defaultpath, f))
-    path.extend(systemrcpath())
-    path.extend(userrcpath())
-    path = [os.path.normpath(f) for f in path]
-    return path
-
-_rcpath = None
-
-def rcpath():
-    '''return hgrc search path. if env var HGRCPATH is set, use it.
-    for each item in path, if directory, use files ending in .rc,
-    else use item.
-    make HGRCPATH empty to only look in .hg/hgrc of current repo.
-    if no HGRCPATH, use default os-specific path.'''
-    global _rcpath
-    if _rcpath is None:
-        if 'HGRCPATH' in encoding.environ:
-            _rcpath = []
-            for p in encoding.environ['HGRCPATH'].split(pycompat.ospathsep):
-                if not p:
-                    continue
-                p = util.expandpath(p)
-                if os.path.isdir(p):
-                    for f, kind in osutil.listdir(p):
-                        if f.endswith('.rc'):
-                            _rcpath.append(os.path.join(p, f))
-                else:
-                    _rcpath.append(p)
-        else:
-            _rcpath = osrcpath()
-    return _rcpath
-
 def intrev(rev):
     """Return integer for a given revision that can be used in comparison or
     arithmetic operation"""