diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2558,9 +2558,6 @@ class localrepository: else: # discard all changes (including ones already written # out) in this transaction - narrowspec.restorebackup(self, b'journal.narrowspec') - narrowspec.restorewcbackup(self, b'journal.narrowspec.dirstate') - repo.invalidate(clearfilecache=True) tr = transaction.transaction( @@ -2688,8 +2685,6 @@ class localrepository: def _journalfiles(self): return ( (self.svfs, b'journal'), - (self.svfs, b'journal.narrowspec'), - (self.vfs, b'journal.narrowspec.dirstate'), (self.vfs, b'journal.branch'), (self.vfs, b'journal.desc'), (bookmarks.bookmarksvfs(self), b'journal.bookmarks'), @@ -2701,8 +2696,6 @@ class localrepository: @unfilteredmethod def _writejournal(self, desc): - narrowspec.savewcbackup(self, b'journal.narrowspec.dirstate') - narrowspec.savebackup(self, b'journal.narrowspec') self.vfs.write( b"journal.branch", encoding.fromlocal(self.dirstate.branch()) ) @@ -2820,8 +2813,6 @@ class localrepository: self.dirstate.setparents(self.nullid) self.dirstate.clear() - narrowspec.restorebackup(self, b'undo.narrowspec') - narrowspec.restorewcbackup(self, b'undo.narrowspec.dirstate') try: branch = self.vfs.read(b'undo.branch') self.dirstate.setbranch(encoding.tolocal(branch)) diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py --- a/mercurial/narrowspec.py +++ b/mercurial/narrowspec.py @@ -14,7 +14,6 @@ from . import ( match as matchmod, merge, mergestate as mergestatemod, - requirements, scmutil, sparse, util, @@ -242,46 +241,6 @@ def copytoworkingcopy(repo): ) -def savebackup(repo, backupname): - if requirements.NARROW_REQUIREMENT not in repo.requirements: - return - svfs = repo.svfs - svfs.tryunlink(backupname) - util.copyfile(svfs.join(FILENAME), svfs.join(backupname), hardlink=True) - - -def restorebackup(repo, backupname): - if requirements.NARROW_REQUIREMENT not in repo.requirements: - return - util.rename(repo.svfs.join(backupname), repo.svfs.join(FILENAME)) - - -def savewcbackup(repo, backupname): - if requirements.NARROW_REQUIREMENT not in repo.requirements: - return - vfs = repo.vfs - vfs.tryunlink(backupname) - # It may not exist in old repos - if vfs.exists(DIRSTATE_FILENAME): - util.copyfile( - vfs.join(DIRSTATE_FILENAME), vfs.join(backupname), hardlink=True - ) - - -def restorewcbackup(repo, backupname): - if requirements.NARROW_REQUIREMENT not in repo.requirements: - return - # It may not exist in old repos - if repo.vfs.exists(backupname): - util.rename(repo.vfs.join(backupname), repo.vfs.join(DIRSTATE_FILENAME)) - - -def clearwcbackup(repo, backupname): - if requirements.NARROW_REQUIREMENT not in repo.requirements: - return - repo.vfs.tryunlink(backupname) - - def restrictpatterns(req_includes, req_excludes, repo_includes, repo_excludes): r"""Restricts the patterns according to repo settings, results in a logical AND operation diff --git a/tests/test-narrow-clone-stream.t b/tests/test-narrow-clone-stream.t --- a/tests/test-narrow-clone-stream.t +++ b/tests/test-narrow-clone-stream.t @@ -90,7 +90,6 @@ Making sure store has the required files requires undo undo.backupfiles - undo.narrowspec undo.phaseroots Checking that repository has all the required data and not broken