Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
31760:68f263f52d2e | 31797:0b913e1e725b |
---|---|
866 with dstrepo.transaction('upgrade') as tr: | 866 with dstrepo.transaction('upgrade') as tr: |
867 _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, | 867 _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, |
868 'redeltamultibase' in actions) | 868 'redeltamultibase' in actions) |
869 | 869 |
870 # Now copy other files in the store directory. | 870 # Now copy other files in the store directory. |
871 for p, kind, st in srcrepo.store.vfs.readdir('', stat=True): | 871 # The sorted() makes execution deterministic. |
872 for p, kind, st in sorted(srcrepo.store.vfs.readdir('', stat=True)): | |
872 if not _upgradefilterstorefile(srcrepo, dstrepo, requirements, | 873 if not _upgradefilterstorefile(srcrepo, dstrepo, requirements, |
873 p, kind, st): | 874 p, kind, st): |
874 continue | 875 continue |
875 | 876 |
876 srcrepo.ui.write(_('copying %s\n') % p) | 877 srcrepo.ui.write(_('copying %s\n') % p) |