changeset 39493:7eadc9407867

ancestor: filter out initial revisions lower than stoprev
author Yuya Nishihara <yuya@tcha.org>
date Sat, 08 Sep 2018 10:59:24 +0900
parents 431068d7e9db
children 8eb2145ff0fb
files mercurial/ancestor.py tests/test-ancestor.py.out
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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]