Patchwork [03,of,12] localrepo: updatebranchcache when destroying nodes

login
register
mail settings
Submitter Idan Kamara
Date Dec. 17, 2012, 3:35 p.m.
Message ID <bb150967c8d0ee6fd3b4.1355758528@idan>
Download mbox | patch
Permalink /patch/157/
State Changes Requested, archived
Headers show

Comments

Idan Kamara - Dec. 17, 2012, 3:35 p.m.
# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1355692572 -7200
# Branch stable
# Node ID bb150967c8d0ee6fd3b43fd9d9470f90bbb10b9d
# Parent  4a0fc140180ba30fb37073e8b721b8a092e4541a
localrepo: updatebranchcache when destroying nodes

This was previously called directly during strip. Moving it to destroying
also means that it'll be called through _rollback, which seems harmless.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1487,7 +1487,10 @@ 
         changes to stay in memory (waiting for the next unlock), or vanish
         completely.
         '''
-        pass
+        # It simplifies the logic around updating the branchheads cache if we
+        # only have to consider the effect of the stripped revisions and not
+        # revisions missing because the cache is out-of-date.
+        self.updatebranchcache()
 
     def destroyed(self, newheadnodes=None):
         '''Inform the repository that nodes have been destroyed.
diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -56,10 +56,6 @@ 
     return s
 
 def strip(ui, repo, nodelist, backup="all", topic='backup'):
-    # It simplifies the logic around updating the branchheads cache if we only
-    # have to consider the effect of the stripped revisions and not revisions
-    # missing because the cache is out-of-date.
-    repo.updatebranchcache()
     repo.destroying()
 
     cl = repo.changelog