Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revlog.py @ 17009:0c18aed2fcca
revlog: remove reachable and switch call sites to ancestors
This change does a trivial conversion of callsites to ancestors.
Followon diffs will switch the callsites over to revs.
author | Joshua Redstone <joshua.redstone@fb.com> |
---|---|
date | Fri, 08 Jun 2012 08:39:44 -0700 |
parents | 553e8f5aba7a |
children | 1028a1c9077a e7167007c083 |
line wrap: on
line diff
--- a/mercurial/revlog.py Fri Jun 08 07:59:37 2012 -0700 +++ b/mercurial/revlog.py Fri Jun 08 08:39:44 2012 -0700 @@ -361,29 +361,6 @@ return len(t) size = rawsize - def reachable(self, node, stop=None): - """return the set of all nodes ancestral to a given node, including - the node itself, stopping when stop is matched""" - reachable = set((node,)) - visit = util.deque([node]) - if stop: - stopn = self.rev(stop) - else: - stopn = 0 - while visit: - n = visit.popleft() - if n == stop: - continue - if n == nullid: - continue - for p in self.parents(n): - if self.rev(p) < stopn: - continue - if p not in reachable: - reachable.add(p) - visit.append(p) - return reachable - def ancestors(self, revs, stoprev=0): """Generate the ancestors of 'revs' in reverse topological order. Does not generate revs lower than stoprev.