diff mercurial/dirstateguard.py @ 41227:b74481038438

narrow: make dirstateguard back up and restore working copy narrowspec instead We used to have only one narrowspec for the store and the working copy, but now that we have one narrowspec for each, it seems clear that the dirstateguard was supposed to back up and restore the narrowspec associated with the working copy, not the one associated with the store. clearbackup() (for the store narrowspec) is not needed because the presence of the file in localrepository._journalfiles() takes care of that. Differential Revision: https://phab.mercurial-scm.org/D5504
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 29 Dec 2018 22:27:39 -0800
parents ad24b581e4d9
children 57875cf423c9
line wrap: on
line diff
--- a/mercurial/dirstateguard.py	Thu Jan 10 13:36:25 2019 -0800
+++ b/mercurial/dirstateguard.py	Sat Dec 29 22:27:39 2018 -0800
@@ -37,7 +37,7 @@
         self._narrowspecbackupname = ('narrowspec.backup.%s.%d' %
                                       (name, id(self)))
         repo.dirstate.savebackup(repo.currenttransaction(), self._backupname)
-        narrowspec.savebackup(repo, self._narrowspecbackupname)
+        narrowspec.savewcbackup(repo, self._narrowspecbackupname)
         self._active = True
 
     def __del__(self):
@@ -56,12 +56,12 @@
 
         self._repo.dirstate.clearbackup(self._repo.currenttransaction(),
                                          self._backupname)
-        narrowspec.clearbackup(self._repo, self._narrowspecbackupname)
+        narrowspec.clearwcbackup(self._repo, self._narrowspecbackupname)
         self._active = False
         self._closed = True
 
     def _abort(self):
-        narrowspec.restorebackup(self._repo, self._narrowspecbackupname)
+        narrowspec.restorewcbackup(self._repo, self._narrowspecbackupname)
         self._repo.dirstate.restorebackup(self._repo.currenttransaction(),
                                            self._backupname)
         self._active = False