mercurial/revlog.py
changeset 16868 eb88ed4269c5
parent 16867 1093ad1e8903
child 16885 d628bcb3a567
--- a/mercurial/revlog.py	Fri Jun 01 12:45:16 2012 -0700
+++ b/mercurial/revlog.py	Fri Jun 01 15:44:13 2012 -0700
@@ -381,8 +381,9 @@
                     visit.append(p)
         return reachable
 
-    def ancestors(self, revs):
+    def ancestors(self, revs, stoprev=0):
         """Generate the ancestors of 'revs' in reverse topological order.
+        Does not generate revs lower than stoprev.
 
         Yield a sequence of revision numbers starting with the parents
         of each revision in revs, i.e., each revision is *not* considered
@@ -393,6 +394,8 @@
         seen = set([nullrev])
         while visit:
             for parent in self.parentrevs(visit.popleft()):
+                if parent < stoprev:
+                    continue
                 if parent not in seen:
                     visit.append(parent)
                     seen.add(parent)