test-ancestor: add a test for ancestor with ancestry within the initset

I was wondering if revisions in the initial set that are still ancestors of other
elements in the initial set were yielded by `changelog.ancestors`. I now have my
answer (they do) and Mercurial has a new test.
This commit is contained in:
Pierre-Yves David 2014-08-30 11:39:15 +02:00
parent cb0b9120c1
commit 1f9120a498
2 changed files with 6 additions and 0 deletions

View File

@ -91,6 +91,10 @@ def test_lazyancestors():
s = genlazyancestors([11, 13])
printlazyancestors(s, [11, 13, 7, 9, 8, 3, 6, 4, 1, -1, 0])
# Standard with ancestry in the initial set (1 is ancestor of 3)
s = genlazyancestors([1, 3])
printlazyancestors(s, [1, -1, 0])
# Including revs
s = genlazyancestors([11, 13], inclusive=True)
printlazyancestors(s, [11, 13, 7, 9, 8, 3, 6, 4, 1, -1, 0])

View File

@ -38,6 +38,8 @@
[]
% lazy ancestor set for [11, 13], stoprev = 0, inclusive = False
[7, 8, 3, 4, 1, 0]
% lazy ancestor set for [1, 3], stoprev = 0, inclusive = False
[1, 0]
% lazy ancestor set for [11, 13], stoprev = 0, inclusive = True
[11, 13, 7, 8, 3, 4, 1, 0]
% lazy ancestor set for [11, 13], stoprev = 6, inclusive = False