# HG changeset patch # User Gregory Szorc # Date 1491676599 25200 # Node ID 8110d49e0558d3b50f8e82b5aa95c8f0e53e47e4 # Parent 8c9178d647f7eb9d4408983681851bab34cfcc40 repair: use rawvfs when copying extra store files If we use the normal vfs, store encoding will be applied when we .join() the path to be copied. This results in attempting to copy a file that (likely) doesn't exist. Using the rawvfs operates on the raw file path, which is returned by vfs.readdir(). Users at Mozilla are encountering this, as I've instructed them to run `hg debugupgraderepo` to upgrade to generaldelta. While Mercurial shouldn't deposit any files under .hg/store that require encoding, it is possible for e.g. .DS_Store files to be created by the operating system. diff -r 8c9178d647f7 -r 8110d49e0558 mercurial/repair.py --- a/mercurial/repair.py Sat Apr 08 11:35:29 2017 -0700 +++ b/mercurial/repair.py Sat Apr 08 11:36:39 2017 -0700 @@ -875,8 +875,8 @@ continue srcrepo.ui.write(_('copying %s\n') % p) - src = srcrepo.store.vfs.join(p) - dst = dstrepo.store.vfs.join(p) + src = srcrepo.store.rawvfs.join(p) + dst = dstrepo.store.rawvfs.join(p) util.copyfile(src, dst, copystat=True) _upgradefinishdatamigration(ui, srcrepo, dstrepo, requirements) diff -r 8c9178d647f7 -r 8110d49e0558 tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t Sat Apr 08 11:35:29 2017 -0700 +++ b/tests/test-upgrade-repo.t Sat Apr 08 11:36:39 2017 -0700 @@ -339,8 +339,16 @@ finished migrating 1 changelog revisions; change in size: 0 bytes finished migrating 3 total revisions; total change in store size: 0 bytes copying .XX_special_filename + copying phaseroots + data fully migrated to temporary repository + marking source repository as being upgraded; clients will be unable to read from repository + starting in-place swap of repository data + replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob) + replacing store... + store replacement complete; repository was inconsistent for *s (glob) + finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob) - abort: No such file or directory: $TESTTMP/store-filenames/.hg/store/~2e_x_x__special__filename - [255] + copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob) + the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ cd ..