comparison mercurial/scmwindows.py @ 43924:fa3835a15a17

windows: don't return early from building the hgrc search path This will minimize the changes needed to add other sources. Differential Revision: https://phab.mercurial-scm.org/D7690
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 17 Dec 2019 21:21:36 -0500
parents 9a3ac902d597
children 7929bb58146f
comparison
equal deleted inserted replaced
43923:9a3ac902d597 43924:fa3835a15a17
36 rcpath.append(os.path.join(progrcd, f)) 36 rcpath.append(os.path.join(progrcd, f))
37 # next look for a system rcpath in the registry 37 # next look for a system rcpath in the registry
38 value = util.lookupreg( 38 value = util.lookupreg(
39 b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE 39 b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE
40 ) 40 )
41 if not isinstance(value, bytes) or not value: 41 if value and isinstance(value, bytes):
42 return rcpath 42 value = util.localpath(value)
43 value = util.localpath(value) 43 for p in value.split(pycompat.ospathsep):
44 for p in value.split(pycompat.ospathsep): 44 if p.lower().endswith(b'mercurial.ini'):
45 if p.lower().endswith(b'mercurial.ini'): 45 rcpath.append(p)
46 rcpath.append(p) 46 elif os.path.isdir(p):
47 elif os.path.isdir(p): 47 for f, kind in util.listdir(p):
48 for f, kind in util.listdir(p): 48 if f.endswith(b'.rc'):
49 if f.endswith(b'.rc'): 49 rcpath.append(os.path.join(p, f))
50 rcpath.append(os.path.join(p, f))
51 return rcpath 50 return rcpath
52 51
53 52
54 def userrcpath(): 53 def userrcpath():
55 '''return os-specific hgrc search path to the user dir''' 54 '''return os-specific hgrc search path to the user dir'''