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

login
register
mail settings
Submitter Idan Kamara
Date Dec. 17, 2012, 3:35 p.m.
Message ID <aa6a85e47fb4edc70595.1355758529@idan>
Download mbox | patch
Permalink /patch/158/
State Superseded, archived
Commit 7331ee72f99cbdc608836dcff0129ce0f01048c5
Headers show

Comments

Idan Kamara - Dec. 17, 2012, 3:35 p.m.
# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1355595359 -7200
# Branch stable
# Node ID aa6a85e47fb4edc705959da93fb024aef56dafd4
# Parent  bb150967c8d0ee6fd3b43fd9d9470f90bbb10b9d
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
@@ -1492,6 +1492,12 @@ 
         # revisions missing because the cache is out-of-date.
         self.updatebranchcache()
 
+        # 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()
+
     def destroyed(self, newheadnodes=None):
         '''Inform the repository that nodes have been destroyed.
         Intended for use by strip and rollback, so there's a common