D7777: rcutil: drop the `defaultrcpath()` method (API)

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Mon Dec 30 05:43:28 UTC 2019


mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7777

AFFECTED FILES
  mercurial/rcutil.py
  tests/test-config-env.py

CHANGE DETAILS

diff --git a/tests/test-config-env.py b/tests/test-config-env.py
--- a/tests/test-config-env.py
+++ b/tests/test-config-env.py
@@ -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
diff --git a/mercurial/rcutil.py b/mercurial/rcutil.py
--- a/mercurial/rcutil.py
+++ b/mercurial/rcutil.py
@@ -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



To: mharbison72, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list