diff mercurial/repair.py @ 31797:0b913e1e725b stable

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 08 Apr 2017 11:35:00 -0700
parents f2c069bf78ee
children 8110d49e0558
line wrap: on
line diff
--- 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