changeset 43918:86fe85364811

rcutil: don't check if defaultrc/ is a directory -- we know it is `mercurial/defaultrc/` is a directory both in the Mercurial repo and once installed on a target platform. The directory was created in c4ce077588d0 (config: introduce "built-in" default configuration settings in default.d, 2014-09-04). That commit has some more information, but it still doesn't seem to say that `defaultrc/` (then called `default.d/`) could be a file. Perhaps the check was there to allow you to run the same code on an older install/repo? Differential Revision: https://phab.mercurial-scm.org/D7624
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 11 Dec 2019 11:22:37 -0800
parents 40fd1ef4e4c1
children 6b6872822b32
files mercurial/rcutil.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/rcutil.py	Fri Nov 29 17:30:57 2019 +0100
+++ b/mercurial/rcutil.py	Wed Dec 11 11:22:37 2019 -0800
@@ -63,11 +63,8 @@
 
 def defaultrcpath():
     '''return rc paths in defaultrc'''
-    path = []
     defaultpath = os.path.join(resourceutil.datapath, b'defaultrc')
-    if os.path.isdir(defaultpath):
-        path = _expandrcpath(defaultpath)
-    return path
+    return _expandrcpath(defaultpath)
 
 
 def rccomponents():