changeset 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
files mercurial/scmwindows.py
diffstat 1 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmwindows.py	Tue Dec 17 21:15:59 2019 -0500
+++ b/mercurial/scmwindows.py	Tue Dec 17 21:21:36 2019 -0500
@@ -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