Patchwork [3,of,9] test-revset: add a few more tests of descendants()

login
register
mail settings
Submitter Yuya Nishihara
Date June 25, 2017, 3:26 a.m.
Message ID <58530a54c89dc9de8fbb.1498361172@mimosa>
Download mbox | patch
Permalink /patch/21684/
State Accepted
Headers show

Comments

Yuya Nishihara - June 25, 2017, 3:26 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1497964283 -32400
#      Tue Jun 20 22:11:23 2017 +0900
# Node ID 58530a54c89dc9de8fbb3e487f6e3af28cd3f5b4
# Parent  d00125578b5af1d0c4a8c6666257ed202ba7eb4b
test-revset: add a few more tests of descendants()

I'll add depth support to descendants().

Patch

diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -935,6 +935,51 @@  test bad arguments passed to ancestors()
   hg: parse error: ancestors expects an integer depth
   [255]
 
+test descendants
+
+  $ hg log -G -T '{rev}\n' --config experimental.graphshorten=True
+  @  9
+  o  8
+  | o  7
+  | o  6
+  |/|
+  | o  5
+  o |  4
+  | o  3
+  o |  2
+  |/
+  o  1
+  o  0
+
+ (null is ultimate root and has optimized path)
+
+  $ log 'null:4 & descendants(null)'
+  -1
+  0
+  1
+  2
+  3
+  4
+
+ (including merge)
+
+  $ log ':8 & descendants(2)'
+  2
+  4
+  6
+  7
+  8
+
+ (multiple roots)
+
+  $ log ':8 & descendants(2+5)'
+  2
+  4
+  5
+  6
+  7
+  8
+
 test author
 
   $ log 'author(bob)'