diff -r 9cc55b743713 -r 57875cf423c9 mercurial/rcutil.py --- a/mercurial/rcutil.py Fri Oct 04 15:53:45 2019 -0400 +++ b/mercurial/rcutil.py Sat Oct 05 10:29:34 2019 -0400 @@ -24,15 +24,18 @@ systemrcpath = scmplatform.systemrcpath userrcpath = scmplatform.userrcpath + def _expandrcpath(path): '''path could be a file or a directory. return a list of file paths''' p = util.expandpath(path) if os.path.isdir(p): join = os.path.join - return sorted(join(p, f) for f, k in util.listdir(p) - if f.endswith('.rc')) + return sorted( + join(p, f) for f, k in util.listdir(p) if f.endswith('.rc') + ) return [p] + def envrcitems(env=None): '''Return [(section, name, value, source)] config items. @@ -55,6 +58,7 @@ result.append((section, configname, env[envname], '$%s' % envname)) return result + def defaultrcpath(): '''return rc paths in default.d''' path = [] @@ -63,6 +67,7 @@ path = _expandrcpath(defaultpath) return path + def rccomponents(): '''return an ordered [(type, obj)] about where to load configs. @@ -92,6 +97,7 @@ _rccomponents.extend(normpaths(userrcpath())) return _rccomponents + def defaultpagerenv(): '''return a dict of default environment variables and their values, intended to be set before starting a pager.