diff --git a/mercurial/rcutil.py b/mercurial/rcutil.py --- a/mercurial/rcutil.py +++ b/mercurial/rcutil.py @@ -29,7 +29,8 @@ p = util.expandpath(path) if os.path.isdir(p): join = os.path.join - return [join(p, f) for f, k in util.listdir(p) if f.endswith('.rc')] + return sorted(join(p, f) for f, k in util.listdir(p) + if f.endswith('.rc')) return [p] def envrcitems(env=None): diff --git a/tests/test-config.t b/tests/test-config.t --- a/tests/test-config.t +++ b/tests/test-config.t @@ -211,3 +211,12 @@ $ hg log --template '{author}\n' repo user $ cd .. + +configs should be readon in lexicographical order + + $ mkdir configs + $ for i in `$TESTDIR/seq.py 10 99`; do + > printf "[section]\nkey=$i" > configs/$i.rc + > done + $ HGRCPATH=configs hg config section.key + 99