config: read system hgrc in lexicographical order
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 03 Nov 2020 09:56:02 -0800
changeset 45824 9ac96b9fa76e
parent 45823 793976f9029c
child 45825 8f07f5a9c3de
config: read system hgrc in lexicographical order This is similar to edbcf5b239f9 (config: read configs from directories in lexicographical order, 2019-04-03). Apparently I forgot to sort the system hgrc files there. That's fixed by this patch. Differential Revision: https://phab.mercurial-scm.org/D9269
mercurial/scmposix.py
mercurial/scmwindows.py
--- a/mercurial/scmposix.py	Sun Nov 08 20:12:32 2020 +0100
+++ b/mercurial/scmposix.py	Tue Nov 03 09:56:02 2020 -0800
@@ -27,7 +27,7 @@
         rcs.extend(
             [
                 os.path.join(rcdir, f)
-                for f, kind in util.listdir(rcdir)
+                for f, kind in sorted(util.listdir(rcdir))
                 if f.endswith(b".rc")
             ]
         )
--- a/mercurial/scmwindows.py	Sun Nov 08 20:12:32 2020 +0100
+++ b/mercurial/scmwindows.py	Tue Nov 03 09:56:02 2020 -0800
@@ -31,7 +31,7 @@
 
     def _processdir(progrcd):
         if os.path.isdir(progrcd):
-            for f, kind in util.listdir(progrcd):
+            for f, kind in sorted(util.listdir(progrcd)):
                 if f.endswith(b'.rc'):
                     rcpath.append(os.path.join(progrcd, f))