Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 16867:1093ad1e8903
revlog: descendants(*revs) becomes descendants(revs) (API)
Once again making the API more rational, as with ancestors.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 01 Jun 2012 12:45:16 -0700 |
parents | 91f3ac205816 |
children | eb88ed4269c5 |
comparison
equal
deleted
inserted
replaced
16866:91f3ac205816 | 16867:1093ad1e8903 |
---|---|
396 if parent not in seen: | 396 if parent not in seen: |
397 visit.append(parent) | 397 visit.append(parent) |
398 seen.add(parent) | 398 seen.add(parent) |
399 yield parent | 399 yield parent |
400 | 400 |
401 def descendants(self, *revs): | 401 def descendants(self, revs): |
402 """Generate the descendants of 'revs' in revision order. | 402 """Generate the descendants of 'revs' in revision order. |
403 | 403 |
404 Yield a sequence of revision numbers starting with a child of | 404 Yield a sequence of revision numbers starting with a child of |
405 some rev in revs, i.e., each revision is *not* considered a | 405 some rev in revs, i.e., each revision is *not* considered a |
406 descendant of itself. Results are ordered by revision number (a | 406 descendant of itself. Results are ordered by revision number (a |
698 return c | 698 return c |
699 | 699 |
700 def descendant(self, start, end): | 700 def descendant(self, start, end): |
701 if start == nullrev: | 701 if start == nullrev: |
702 return True | 702 return True |
703 for i in self.descendants(start): | 703 for i in self.descendants([start]): |
704 if i == end: | 704 if i == end: |
705 return True | 705 return True |
706 elif i > end: | 706 elif i > end: |
707 break | 707 break |
708 return False | 708 return False |