Mercurial > hg
comparison tests/test-revset.t @ 38705:e4b270a32ba8
revset: special case commonancestors(none()) to be empty set
This matches the behavior of ancestor(none()).
From an implementation perspective, ancestor() and commonancestors() are
intersection, and ancestors() is union, so it would make some sense that
commonancestors(none()) returned all revisions. However, ancestor(none())
isn't implemented as such, which breaks ancestor(x) == max(commonancestors(x)).
From a user perspective, ancestors of nothing is nothing whichever type
of operation the ancestor predicate does.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 12 Jul 2018 23:07:29 +0900 |
parents | 5460926352ee |
children | 7848f284b211 f28812c708a5 |
comparison
equal
deleted
inserted
replaced
38704:607e2a2501e6 | 38705:e4b270a32ba8 |
---|---|
1061 2 | 1061 2 |
1062 4 | 1062 4 |
1063 8 | 1063 8 |
1064 9 | 1064 9 |
1065 | 1065 |
1066 test ancestor variants of empty revision | |
1067 | |
1068 $ log 'ancestor(none())' | |
1069 $ log 'ancestors(none())' | |
1070 $ log 'commonancestors(none())' | |
1071 | |
1066 test ancestors with depth limit | 1072 test ancestors with depth limit |
1067 | 1073 |
1068 (depth=0 selects the node itself) | 1074 (depth=0 selects the node itself) |
1069 | 1075 |
1070 $ log 'reverse(ancestors(9, depth=0))' | 1076 $ log 'reverse(ancestors(9, depth=0))' |