diff 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
line wrap: on
line diff
--- a/mercurial/revlog.py	Sun Nov 07 18:16:07 2010 +0900
+++ b/mercurial/revlog.py	Sun Nov 07 18:23:48 2010 +0900
@@ -607,8 +607,14 @@
         some rev in revs, i.e., each revision is *not* considered a
         descendant of itself.  Results are ordered by revision number (a
         topological sort)."""
+        first = min(revs)
+        if first == nullrev:
+            for i in self:
+                yield i
+            return
+
         seen = set(revs)
-        for i in xrange(min(revs) + 1, len(self)):
+        for i in xrange(first + 1, len(self)):
             for x in self.parentrevs(i):
                 if x != nullrev and x in seen:
                     seen.add(i)