##// END OF EJS Templates
revsets: let parents() return parents of working dir...
revsets: let parents() return parents of working dir This patch makes the 'set' argument to revset function parents() optional. Like p1() and p2(), if no argument is given, returns the parent(s) of the working directory. Morally equivalent to 'p1()+p2()', as expected.

File last commit:

r12929:515c2786 default
r12929:515c2786 default
Show More
test-revset-dirstate-parents.t
48 lines | 658 B | text/troff | Tads3Lexer
/ tests / test-revset-dirstate-parents.t
$ HGENCODING=utf-8
$ export HGENCODING
$ try() {
> hg debugrevspec --debug $@
> }
$ log() {
> hg log --template '{rev}\n' -r "$1"
> }
$ hg init repo
$ cd repo
$ try 'p1()'
('func', ('symbol', 'p1'), None)
-1
$ try 'p2()'
('func', ('symbol', 'p2'), None)
null revision
$ log 'p1()'
$ log 'p2()'
$ log 'parents()'
working dir with a single parent
$ echo a > a
$ hg ci -Aqm0
$ log 'p1()'
0
$ log 'p2()'
$ log 'parents()'
0
merge in progress
$ echo b > b
$ hg ci -Aqm1
$ hg up -q 0
$ echo c > c
$ hg ci -Aqm2
$ hg merge -q
$ log 'p1()'
2
$ log 'p2()'
1
$ log 'parents()'
2
1