##// END OF EJS Templates
rcutil: split osrcpath to return default.d paths (API)...
Jun Wu -
r31680:448889f9 default
parent child Browse files
Show More
@@ -24,17 +24,14 b' else:'
24 24 systemrcpath = scmplatform.systemrcpath
25 25 userrcpath = scmplatform.userrcpath
26 26
27 def osrcpath():
28 '''return default os-specific hgrc search path'''
27 def defaultrcpath():
28 '''return rc paths in default.d'''
29 29 path = []
30 30 defaultpath = os.path.join(util.datapath, 'default.d')
31 31 if os.path.isdir(defaultpath):
32 32 for f, kind in osutil.listdir(defaultpath):
33 33 if f.endswith('.rc'):
34 34 path.append(os.path.join(defaultpath, f))
35 path.extend(systemrcpath())
36 path.extend(userrcpath())
37 path = [os.path.normpath(f) for f in path]
38 35 return path
39 36
40 37 _rcpath = None
@@ -60,5 +57,6 b' def rcpath():'
60 57 else:
61 58 _rcpath.append(p)
62 59 else:
63 _rcpath = osrcpath()
60 paths = defaultrcpath() + systemrcpath() + userrcpath()
61 _rcpath = pycompat.maplist(os.path.normpath, paths)
64 62 return _rcpath
General Comments 0
You need to be logged in to leave comments. Login now