ancestor: filter out initial revisions lower than stoprev
authorYuya Nishihara <yuya@tcha.org>
Sat, 08 Sep 2018 10:59:24 +0900
changeset 39476 7eadc9407867
parent 39475 431068d7e9db
child 39477 8eb2145ff0fb
ancestor: filter out initial revisions lower than stoprev
mercurial/ancestor.py
tests/test-ancestor.py.out
--- a/mercurial/ancestor.py	Sat Sep 08 10:48:42 2018 +0900
+++ b/mercurial/ancestor.py	Sat Sep 08 10:59:24 2018 +0900
@@ -273,7 +273,7 @@
 
         Result does not include the null revision."""
         self._parentrevs = pfunc
-        self._initrevs = revs
+        self._initrevs = revs = [r for r in revs if r >= stoprev]
         self._stoprev = stoprev
         self._inclusive = inclusive
 
--- a/tests/test-ancestor.py.out	Sat Sep 08 10:48:42 2018 +0900
+++ b/tests/test-ancestor.py.out	Sat Sep 08 10:59:24 2018 +0900
@@ -20,5 +20,5 @@
 membership: [11, 13]
 iteration:  [13, 11]
 % lazy ancestor set for [11, 13], stoprev = 12, inclusive = True
-membership: [11, 13]
+membership: [13]
 iteration:  [13]