rcutil: drop the `defaultrcpath()` method (API)
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 29 Dec 2019 21:10:04 -0500
changeset 44032 2d4cad94d08a
parent 44031 1864efbe90d9
child 44034 ab595920de0e
rcutil: drop the `defaultrcpath()` method (API) The resource based code can service py2, py3 and an oxidized executable, so there's no reason to leave this around. It was flagged as an API change when it was introduced, so flagging it again. Differential Revision: https://phab.mercurial-scm.org/D7777
mercurial/rcutil.py
tests/test-config-env.py
--- a/mercurial/rcutil.py	Sun Dec 29 21:06:34 2019 -0500
+++ b/mercurial/rcutil.py	Sun Dec 29 21:10:04 2019 -0500
@@ -61,12 +61,6 @@
     return result
 
 
-def defaultrcpath():
-    '''return rc paths in defaultrc'''
-    defaultpath = os.path.join(resourceutil.datapath, b'defaultrc')
-    return _expandrcpath(defaultpath)
-
-
 def default_rc_resources():
     """return rc resource IDs in defaultrc"""
     rsrcs = resourceutil.contents(b'mercurial.defaultrc')
@@ -107,7 +101,7 @@
         normpaths = lambda paths: [
             (b'path', os.path.normpath(p)) for p in paths
         ]
-        _rccomponents.extend(normpaths(defaultrcpath() + systemrcpath()))
+        _rccomponents.extend(normpaths(systemrcpath()))
         _rccomponents.append(envrc)
         _rccomponents.extend(normpaths(userrcpath()))
     return _rccomponents
--- a/tests/test-config-env.py	Sun Dec 29 21:06:34 2019 -0500
+++ b/tests/test-config-env.py	Sun Dec 29 21:10:04 2019 -0500
@@ -36,7 +36,6 @@
     return [join(b'userrc')]
 
 
-extensions.wrapfunction(rcutil, 'defaultrcpath', lambda orig: [])
 extensions.wrapfunction(rcutil, 'default_rc_resources', lambda orig: [])
 
 rcutil.systemrcpath = systemrcpath