Patchwork [04,of,10,v2] localrepo: write the phasecache when destroying nodes

login
register
mail settings
Submitter Idan Kamara
Date Jan. 10, 2013, 10:10 p.m.
Message ID <d995557a854b835d65b3.1357855851@idan>
Download mbox | patch
Permalink /patch/559/
State Accepted
Commit 7331ee72f99cbdc608836dcff0129ce0f01048c5
Delegated to: Kevin Bullock
Headers show

Comments

Idan Kamara - Jan. 10, 2013, 10:10 p.m.
# HG changeset patch
# User Idan Kamara <idankk86@gmail.com>
# Date 1357855552 -7200
# Node ID d995557a854b835d65b3cde1d4ca5eaa2666471e
# Parent  f995192c3e645becb51669cbad6e543f1f876199
localrepo: write the phasecache when destroying nodes

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1396,6 +1396,12 @@ 
         # revisions missing because the cache is out-of-date.
         branchmap.updatecache(self)
 
+        # When using the same lock to commit and strip, the phasecache is left
+        # dirty after committing. Then when we strip, the repo is invalidated,
+        # causing those changes to disappear.
+        if '_phasecache' in vars(self):
+            self._phasecache.write()
+
     @unfilteredmethod
     def destroyed(self, newheadnodes=None):
         '''Inform the repository that nodes have been destroyed.