changeset 22355:731b2a90983b

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 30 Aug 2014 11:39:15 +0200
parents a89add6c6b2f
children 3c8fb24334e9
files tests/test-ancestor.py tests/test-ancestor.py.out
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-ancestor.py	Tue Aug 26 12:47:41 2014 +0200
+++ b/tests/test-ancestor.py	Sat Aug 30 11:39:15 2014 +0200
@@ -91,6 +91,10 @@
     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])
--- a/tests/test-ancestor.py.out	Tue Aug 26 12:47:41 2014 +0200
+++ b/tests/test-ancestor.py.out	Sat Aug 30 11:39:15 2014 +0200
@@ -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