comparison mercurial/dagutil.py @ 35304:f77121b6bf1b

setdiscover: allow to ignore part of the local graph Currently, the push discovery first determines the full set of common nodes before looking into what changesets are outgoing. When pushing a specific subset, this can lead to pathological situations where we search for the status of thousand of local heads that are unrelated to the requested pushes. To fix this, we need to teach the discovery to ignores part of the graph. Most of the necessary pieces were already in place. This changeset just makes them available to higher level API and tests them. Change actually impacting pushes are coming in a later changeset.
author Boris Feld <boris.feld@octobus.net>
date Wed, 06 Dec 2017 22:44:51 +0100
parents 09397d0dd3b7
children 0e46b92b37b1
comparison
equal deleted inserted replaced
35303:67b7e39b441b 35304:f77121b6bf1b
152 152
153 153
154 class revlogdag(revlogbaseddag): 154 class revlogdag(revlogbaseddag):
155 '''dag interface to a revlog''' 155 '''dag interface to a revlog'''
156 156
157 def __init__(self, revlog): 157 def __init__(self, revlog, localsubset=None):
158 revlogbaseddag.__init__(self, revlog, set(revlog)) 158 revlogbaseddag.__init__(self, revlog, set(revlog))
159 self._heads = localsubset
159 160
160 def _getheads(self): 161 def _getheads(self):
161 return [r for r in self._revlog.headrevs() if r != nullrev] 162 return [r for r in self._revlog.headrevs() if r != nullrev]
162 163
163 def parents(self, ix): 164 def parents(self, ix):