comparison mercurial/rcutil.py @ 44032:2d4cad94d08a

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
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 29 Dec 2019 21:10:04 -0500
parents 1864efbe90d9
children 238790674d69
comparison
equal deleted inserted replaced
44031:1864efbe90d9 44032:2d4cad94d08a
59 continue 59 continue
60 result.append((section, configname, env[envname], b'$%s' % envname)) 60 result.append((section, configname, env[envname], b'$%s' % envname))
61 return result 61 return result
62 62
63 63
64 def defaultrcpath():
65 '''return rc paths in defaultrc'''
66 defaultpath = os.path.join(resourceutil.datapath, b'defaultrc')
67 return _expandrcpath(defaultpath)
68
69
70 def default_rc_resources(): 64 def default_rc_resources():
71 """return rc resource IDs in defaultrc""" 65 """return rc resource IDs in defaultrc"""
72 rsrcs = resourceutil.contents(b'mercurial.defaultrc') 66 rsrcs = resourceutil.contents(b'mercurial.defaultrc')
73 return [ 67 return [
74 (b'mercurial.defaultrc', r) 68 (b'mercurial.defaultrc', r)
105 _rccomponents = [(b'resource', r) for r in default_rc_resources()] 99 _rccomponents = [(b'resource', r) for r in default_rc_resources()]
106 100
107 normpaths = lambda paths: [ 101 normpaths = lambda paths: [
108 (b'path', os.path.normpath(p)) for p in paths 102 (b'path', os.path.normpath(p)) for p in paths
109 ] 103 ]
110 _rccomponents.extend(normpaths(defaultrcpath() + systemrcpath())) 104 _rccomponents.extend(normpaths(systemrcpath()))
111 _rccomponents.append(envrc) 105 _rccomponents.append(envrc)
112 _rccomponents.extend(normpaths(userrcpath())) 106 _rccomponents.extend(normpaths(userrcpath()))
113 return _rccomponents 107 return _rccomponents
114 108
115 109