comparison mercurial/revlog.py @ 12950:2405b4a5964a stable

revlog: fix descendants() if nullrev is in revs We were not returning the correct result if nullrev was in revs, as we are checking parent(currentrev) != nullrev before yielding currentrev test-convert-hg-startrev was wrong: if we start converting from rev -1 and onwards, all the descendants of -1 (full repo) should be converted.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sun, 07 Nov 2010 18:23:48 +0900
parents 6878eaa5a40d
children 3da456d0c885
comparison
equal deleted inserted replaced
12949:6878eaa5a40d 12950:2405b4a5964a
605 605
606 Yield a sequence of revision numbers starting with a child of 606 Yield a sequence of revision numbers starting with a child of
607 some rev in revs, i.e., each revision is *not* considered a 607 some rev in revs, i.e., each revision is *not* considered a
608 descendant of itself. Results are ordered by revision number (a 608 descendant of itself. Results are ordered by revision number (a
609 topological sort).""" 609 topological sort)."""
610 first = min(revs)
611 if first == nullrev:
612 for i in self:
613 yield i
614 return
615
610 seen = set(revs) 616 seen = set(revs)
611 for i in xrange(min(revs) + 1, len(self)): 617 for i in xrange(first + 1, len(self)):
612 for x in self.parentrevs(i): 618 for x in self.parentrevs(i):
613 if x != nullrev and x in seen: 619 if x != nullrev and x in seen:
614 seen.add(i) 620 seen.add(i)
615 yield i 621 yield i
616 break 622 break