# HG changeset patch # User Pierre-Yves David # Date 2013-01-17 16:51:30 # Node ID 64848f7fb7642bd1554c97049cc08d049b02941c # Parent ecba9b0e767254c2b241657a9b591a2480f5811c 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. diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -90,6 +90,8 @@ def computeimpactable(repo): for roots in repo._phasecache.phaseroots[1:]: if roots: firstmutable = min(firstmutable, min(cl.rev(r) for r in roots)) + # protect from nullrev root + firstmutable = max(0, firstmutable) return frozenset(xrange(firstmutable, len(cl))) # function to compute filtered set