D7690: windows: don't return early from building the hgrc search path
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Wed Dec 18 01:46:28 EST 2019
Closed by commit rHGfa3835a15a17: windows: don't return early from building the hgrc search path (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D7690?vs=18835&id=18850
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7690/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7690
AFFECTED FILES
mercurial/scmwindows.py
CHANGE DETAILS
diff --git a/mercurial/scmwindows.py b/mercurial/scmwindows.py
--- a/mercurial/scmwindows.py
+++ b/mercurial/scmwindows.py
@@ -38,16 +38,15 @@
value = util.lookupreg(
b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE
)
- if not isinstance(value, bytes) or not value:
- return rcpath
- value = util.localpath(value)
- for p in value.split(pycompat.ospathsep):
- if p.lower().endswith(b'mercurial.ini'):
- rcpath.append(p)
- elif os.path.isdir(p):
- for f, kind in util.listdir(p):
- if f.endswith(b'.rc'):
- rcpath.append(os.path.join(p, f))
+ if value and isinstance(value, bytes):
+ value = util.localpath(value)
+ for p in value.split(pycompat.ospathsep):
+ if p.lower().endswith(b'mercurial.ini'):
+ rcpath.append(p)
+ elif os.path.isdir(p):
+ for f, kind in util.listdir(p):
+ if f.endswith(b'.rc'):
+ rcpath.append(os.path.join(p, f))
return rcpath
To: mharbison72, #hg-reviewers, pulkit
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list