Patchwork [2,of,3] branchmap: remove the droppednodes logic

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 30, 2013, 3:54 p.m.
Message ID <7be0821862b28497d6ea.1380556463@vulgaris>
Download mbox | patch
Permalink /patch/2675/
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 1380555099 -7200
#      Mon Sep 30 17:31:39 2013 +0200
# Node ID 7be0821862b28497d6ea9607178f6e15135f8666
# Parent  2c13179e5107a9008c11a83f13f95cca39bc644f
branchmap: remove the droppednodes logic

It was unused. note how it is only extended if the list is empty. So it's always
empty at the end.

We could try to fix that, however this would part of the code is to be removed
in the next changeset as we do not run `branchmap` on truncated repo since
`repoview` in 2.5.

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -201,19 +201,17 @@  class branchcache(dict):
         # 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.
-        droppednodes = []
         for branch in self.keys():
             nodes = [head for head in self[branch]
                      if cl.hasnode(head)]
             if not nodes:
-                droppednodes.extend(nodes)
                 del self[branch]
 
-        if ((not self.validfor(repo)) or (self.tipnode in droppednodes)):
+        if not self.validfor(repo):
             # cache key are not valid anymore
             self.tipnode = nullid
             self.tiprev = nullrev
             for heads in self.values():
                 tiprev = max(cl.rev(node) for node in heads)