Patchwork [03,of,10,v2] localrepo: update the branchmap when destroying nodes

login
register
mail settings
Submitter Idan Kamara
Date Jan. 10, 2013, 10:10 p.m.
Message ID <f995192c3e645becb516.1357855850@idan>
Download mbox | patch
Permalink /patch/541/
State Accepted
Commit 08407464875512da82d314e8acc2357e58fa1b37
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 1357397412 -7200
# Node ID f995192c3e645becb51669cbad6e543f1f876199
# Parent  10c413247f0d3f179f8daa2404dc18195f181565
localrepo: update the branchmap 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
@@ -1391,7 +1391,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.
+        branchmap.updatecache(self)
 
     @unfilteredmethod
     def destroyed(self, newheadnodes=None):
diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -6,7 +6,7 @@ 
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from mercurial import changegroup, branchmap
+from mercurial import changegroup
 from mercurial.node import short
 from mercurial.i18n import _
 import os
@@ -57,10 +57,6 @@ 
 
 def strip(ui, repo, nodelist, backup="all", topic='backup'):
     repo = repo.unfiltered()
-    # 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.
-    branchmap.updatecache(repo)
     repo.destroying()
 
     cl = repo.changelog