[PATCH 09 of 11 V2] scmutil: remove rcpath

Jun Wu quark at fb.com
Wed Mar 22 03:50:58 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1489455385 25200
#      Mon Mar 13 18:36:25 2017 -0700
# Node ID 9f90c479585c75ece920043c220093058d968b97
# Parent  23b2b1ed59763e5e676f06a4ac4f6bf567874220
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 9f90c479585c
scmutil: remove rcpath

It's no longer used.

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -423,31 +423,4 @@ def envconfig(envlist, env=None):
     return result
 
-_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:
-            paths = defaultrcpath() + systemrcpath() + userrcpath()
-            _rcpath = map(os.path.normpath, paths)
-    return _rcpath
-
 _rccomponents = None
 


More information about the Mercurial-devel mailing list