comparison mercurial/repoview.py @ 18443:64848f7fb764

repoview: protect `base` computation from weird phase root If for some reason the phase roots contains nullid, the set of filtered revs will contains -1. That confuse Mercurial a lot. In particular this corrupt the branchcache. Standard code path does not result in nullid phase root. It can only result from altered `.hg/store/phaseroots` or buggy extension. However better safe than sorry.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 17 Jan 2013 17:51:30 +0100
parents f3b21beb9802
children 4d92e2d75cff
comparison
equal deleted inserted replaced
18442:ecba9b0e7672 18443:64848f7fb764
88 cl = repo.changelog 88 cl = repo.changelog
89 firstmutable = len(cl) 89 firstmutable = len(cl)
90 for roots in repo._phasecache.phaseroots[1:]: 90 for roots in repo._phasecache.phaseroots[1:]:
91 if roots: 91 if roots:
92 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots)) 92 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
93 # protect from nullrev root
94 firstmutable = max(0, firstmutable)
93 return frozenset(xrange(firstmutable, len(cl))) 95 return frozenset(xrange(firstmutable, len(cl)))
94 96
95 # function to compute filtered set 97 # function to compute filtered set
96 filtertable = {'visible': computehidden, 98 filtertable = {'visible': computehidden,
97 'served': computeunserved, 99 'served': computeunserved,