[PATCH 2 of 2] ancestor: filter out initial revisions lower than stoprev
Yuya Nishihara
yuya at tcha.org
Sat Sep 8 02:51:14 UTC 2018
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1536371964 -32400
# Sat Sep 08 10:59:24 2018 +0900
# Node ID 4894b3cdd4c03bb5579bb47f4f51a9410716df84
# Parent ebcd7abf0d144fb657b90126a1e30d13eefeb364
ancestor: filter out initial revisions lower than stoprev
diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
--- a/mercurial/ancestor.py
+++ b/mercurial/ancestor.py
@@ -273,7 +273,7 @@ class lazyancestors(object):
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
diff --git a/tests/test-ancestor.py.out b/tests/test-ancestor.py.out
--- a/tests/test-ancestor.py.out
+++ b/tests/test-ancestor.py.out
@@ -20,5 +20,5 @@ iteration: [13, 11, 8, 7]
membership: [11, 13]
iteration: [13, 11]
% lazy ancestor set for [11, 13], stoprev = 12, inclusive = True
-membership: [11, 13]
+membership: [13]
iteration: [13]
More information about the Mercurial-devel
mailing list