Patchwork [3,of,3] branchmap: stop looking for stripped branch

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 30, 2013, 3:54 p.m.
Message ID <79c51b73c8b6f14ee7cf.1380556464@vulgaris>
Download mbox | patch
Permalink /patch/2677/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 30, 2013, 3:54 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1380555758 -7200
#      Mon Sep 30 17:42:38 2013 +0200
# Node ID 79c51b73c8b6f14ee7cf218c60fbba01a988694e
# Parent  7be0821862b28497d6ea9607178f6e15135f8666
branchmap: stop looking for stripped branch

Since repoview in 2.5 we do not make special call to `branchmap` when stripping.
We just recompute the branchmap from a lower subset that still has valid
branchmap. So I'm dropping this dead code.

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -196,21 +196,10 @@  class branchcache(dict):
             tiprev = max(bheadrevs)
             if tiprev > self.tiprev:
                 self.tipnode = cl.node(tiprev)
                 self.tiprev = tiprev
 
-        # There may be branches that cease to exist when the last commit in the
-        # branch was stripped.  This code filters them out.  Note that the
-        # branch that ceased to exist may not be in newbranches because
-        # newbranches is the set of candidate heads, which when you strip the
-        # last commit in a branch will be the parent branch.
-        for branch in self.keys():
-            nodes = [head for head in self[branch]
-                     if cl.hasnode(head)]
-            if not nodes:
-                del self[branch]
-
         if not self.validfor(repo):
             # cache key are not valid anymore
             self.tipnode = nullid
             self.tiprev = nullrev
             for heads in self.values():