comparison mercurial/rcutil.py @ 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 5be909dbe385
children 1864efbe90d9
comparison
equal deleted inserted replaced
43917:40fd1ef4e4c1 43918:86fe85364811
61 return result 61 return result
62 62
63 63
64 def defaultrcpath(): 64 def defaultrcpath():
65 '''return rc paths in defaultrc''' 65 '''return rc paths in defaultrc'''
66 path = []
67 defaultpath = os.path.join(resourceutil.datapath, b'defaultrc') 66 defaultpath = os.path.join(resourceutil.datapath, b'defaultrc')
68 if os.path.isdir(defaultpath): 67 return _expandrcpath(defaultpath)
69 path = _expandrcpath(defaultpath)
70 return path
71 68
72 69
73 def rccomponents(): 70 def rccomponents():
74 '''return an ordered [(type, obj)] about where to load configs. 71 '''return an ordered [(type, obj)] about where to load configs.
75 72