changeset 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 68f263f52d2e
children 8c9178d647f7
files mercurial/repair.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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