# HG changeset patch # User Martin von Zweigbergk # Date 1544467188 28800 # Node ID 1e8d9f472ea1d22c5da65ddc2eac28cd36973018 # Parent 92fde28860bbd52361a1206fc83e516768ed1e15 narrow: keep narrowspec backup in store As suggested by Yuya in review of D4099. Differential Revision: https://phab.mercurial-scm.org/D5470 diff -r 92fde28860bb -r 1e8d9f472ea1 mercurial/narrowspec.py --- a/mercurial/narrowspec.py Sat Oct 27 22:56:31 2018 -0700 +++ b/mercurial/narrowspec.py Mon Dec 10 10:39:48 2018 -0800 @@ -160,19 +160,19 @@ def savebackup(repo, backupname): if repository.NARROW_REQUIREMENT not in repo.requirements: return - vfs = repo.vfs - vfs.tryunlink(backupname) - util.copyfile(repo.svfs.join(FILENAME), vfs.join(backupname), hardlink=True) + svfs = repo.svfs + svfs.tryunlink(backupname) + util.copyfile(svfs.join(FILENAME), svfs.join(backupname), hardlink=True) def restorebackup(repo, backupname): if repository.NARROW_REQUIREMENT not in repo.requirements: return - util.rename(repo.vfs.join(backupname), repo.svfs.join(FILENAME)) + util.rename(repo.svfs.join(backupname), repo.svfs.join(FILENAME)) def clearbackup(repo, backupname): if repository.NARROW_REQUIREMENT not in repo.requirements: return - repo.vfs.unlink(backupname) + repo.svfs.unlink(backupname) def restrictpatterns(req_includes, req_excludes, repo_includes, repo_excludes): r""" Restricts the patterns according to repo settings, diff -r 92fde28860bb -r 1e8d9f472ea1 tests/test-narrow-clone-stream.t --- a/tests/test-narrow-clone-stream.t Sat Oct 27 22:56:31 2018 -0700 +++ b/tests/test-narrow-clone-stream.t Mon Dec 10 10:39:48 2018 -0800 @@ -77,6 +77,7 @@ 00manifest.i data (tree flat-fncache !) fncache (tree flat-fncache !) + journal.narrowspec meta (tree !) narrowspec undo