repair: iterate store files deterministically stable
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 08 Apr 2017 11:35:00 -0700
branchstable
changeset 31797 0b913e1e725b
parent 31760 68f263f52d2e
child 31798 8c9178d647f7
repair: iterate store files deterministically An upcoming test will add a 2nd file. Since readdir() is non-deterministic, add a sorted() to make traversal deterministic.
mercurial/repair.py
--- a/mercurial/repair.py	Mon Apr 03 17:34:24 2017 -0400
+++ b/mercurial/repair.py	Sat Apr 08 11:35:00 2017 -0700
@@ -868,7 +868,8 @@
                      'redeltamultibase' in actions)
 
     # Now copy other files in the store directory.
-    for p, kind, st in srcrepo.store.vfs.readdir('', stat=True):
+    # The sorted() makes execution deterministic.
+    for p, kind, st in sorted(srcrepo.store.vfs.readdir('', stat=True)):
         if not _upgradefilterstorefile(srcrepo, dstrepo, requirements,
                                        p, kind, st):
             continue