diff mercurial/util.py @ 13984:af60153b5e3b

move rcpath from util to scmutil
author Adrian Buehlmann <adrian@cadifra.com>
date Thu, 21 Apr 2011 20:14:29 +0200
parents 938fbeacac84
children 26335a817dd0
line wrap: on
line diff
--- a/mercurial/util.py	Thu Apr 21 15:11:28 2011 -0500
+++ b/mercurial/util.py	Thu Apr 21 20:14:29 2011 +0200
@@ -1083,8 +1083,6 @@
     except (UnicodeDecodeError, UnicodeEncodeError):
         return _ellipsis(text, maxlength)[0]
 
-_rcpath = None
-
 def os_rcpath():
     '''return default os-specific hgrc search path'''
     path = system_rcpath()
@@ -1092,30 +1090,6 @@
     path = [os.path.normpath(f) for f in path]
     return path
 
-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 os.environ:
-            _rcpath = []
-            for p in os.environ['HGRCPATH'].split(os.pathsep):
-                if not p:
-                    continue
-                p = 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 = os_rcpath()
-    return _rcpath
-
 def bytecount(nbytes):
     '''return byte count formatted as readable string, with units'''