Mercurial > hg
comparison tests/test-revset.t @ 38624:5460926352ee
revsets: add commonancestors revset
This is a method to reproduce "::x and ::y" such that a set can be sent
in. For instance, it'd be convenient to have "::heads()" work like this
but that already means "::x + ::y + ..." for each element in the
"heads()" set.
Therefore, we add the "commonancestors" method to mean "::x and ::y ..."
for each head in the given set.
author | Sean Farley <sean@farley.io> |
---|---|
date | Mon, 18 Jun 2018 19:41:54 -0700 |
parents | 54d7aaa243cc |
children | e4b270a32ba8 |
comparison
equal
deleted
inserted
replaced
38623:92c845c097aa | 38624:5460926352ee |
---|---|
1039 0 | 1039 0 |
1040 1 | 1040 1 |
1041 2 | 1041 2 |
1042 3 | 1042 3 |
1043 | 1043 |
1044 test common ancestors | |
1045 | |
1046 $ hg log -T '{rev}\n' -r 'commonancestors(7 + 9)' | |
1047 0 | |
1048 1 | |
1049 2 | |
1050 4 | |
1051 | |
1052 $ hg log -T '{rev}\n' -r 'commonancestors(head())' | |
1053 0 | |
1054 1 | |
1055 2 | |
1056 4 | |
1057 | |
1058 $ hg log -T '{rev}\n' -r 'commonancestors(9)' | |
1059 0 | |
1060 1 | |
1061 2 | |
1062 4 | |
1063 8 | |
1064 9 | |
1065 | |
1044 test ancestors with depth limit | 1066 test ancestors with depth limit |
1045 | 1067 |
1046 (depth=0 selects the node itself) | 1068 (depth=0 selects the node itself) |
1047 | 1069 |
1048 $ log 'reverse(ancestors(9, depth=0))' | 1070 $ log 'reverse(ancestors(9, depth=0))' |