Patchwork D5505: narrow: include working copy narrowspec in transaction journal

login
register
mail settings
Submitter phabricator
Date Jan. 10, 2019, 9:51 p.m.
Message ID <2ae6c2fb3d1fe5f5f80e087a9e507f8b@localhost.localdomain>
Download mbox | patch
Permalink /patch/37631/
State Not Applicable
Headers show

Comments

phabricator - Jan. 10, 2019, 9:51 p.m.
martinvonz updated this revision to Diff 13145.
martinvonz marked an inline comment as done.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5505?vs=13054&id=13145

REVISION DETAIL
  https://phab.mercurial-scm.org/D5505

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: pulkit, mjpieters, mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1837,6 +1837,7 @@ 
                 # discard all changes (including ones already written
                 # out) in this transaction
                 narrowspec.restorebackup(self, 'journal.narrowspec')
+                narrowspec.restorewcbackup(self, 'journal.narrowspec.dirstate')
                 repo.dirstate.restorebackup(None, 'journal.dirstate')
 
                 repo.invalidate(clearfilecache=True)
@@ -1914,6 +1915,7 @@ 
     def _journalfiles(self):
         return ((self.svfs, 'journal'),
                 (self.svfs, 'journal.narrowspec'),
+                (self.vfs, 'journal.narrowspec.dirstate'),
                 (self.vfs, 'journal.dirstate'),
                 (self.vfs, 'journal.branch'),
                 (self.vfs, 'journal.desc'),
@@ -1926,6 +1928,7 @@ 
     @unfilteredmethod
     def _writejournal(self, desc):
         self.dirstate.savebackup(None, 'journal.dirstate')
+        narrowspec.savewcbackup(self, 'journal.narrowspec.dirstate')
         narrowspec.savebackup(self, 'journal.narrowspec')
         self.vfs.write("journal.branch",
                           encoding.fromlocal(self.dirstate.branch()))
@@ -2015,6 +2018,7 @@ 
             dsguard.close()
 
             narrowspec.restorebackup(self, 'undo.narrowspec')
+            narrowspec.restorewcbackup(self, 'undo.narrowspec.dirstate')
             self.dirstate.restorebackup(None, 'undo.dirstate')
             try:
                 branch = self.vfs.read('undo.branch')