comparison mercurial/scmwindows.py @ 43748:a50fecefa691 stable 5.2.1

windows: fix an issue causing registry config paths to be ignored on py3 `util.lookupreg()` returns bytes. Differential Revision: https://phab.mercurial-scm.org/D7532
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 30 Nov 2019 02:13:56 -0500
parents 687b865b95ad
children 29adf0a087a1
comparison
equal deleted inserted replaced
43747:5470e63686ca 43748:a50fecefa691
35 rcpath.append(os.path.join(progrcd, f)) 35 rcpath.append(os.path.join(progrcd, f))
36 # else look for a system rcpath in the registry 36 # else look for a system rcpath in the registry
37 value = util.lookupreg( 37 value = util.lookupreg(
38 b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE 38 b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE
39 ) 39 )
40 if not isinstance(value, str) or not value: 40 if not isinstance(value, bytes) or not value:
41 return rcpath 41 return rcpath
42 value = util.localpath(value) 42 value = util.localpath(value)
43 for p in value.split(pycompat.ospathsep): 43 for p in value.split(pycompat.ospathsep):
44 if p.lower().endswith(b'mercurial.ini'): 44 if p.lower().endswith(b'mercurial.ini'):
45 rcpath.append(p) 45 rcpath.append(p)