revset: for x^2, do not take null as a valid p2 revision
Since we don't count null p2 revision as a parent, x^2 should never return
null even if null is explicitly populated.
--- a/mercurial/revset.py Mon Oct 10 22:30:09 2016 +0200
+++ b/mercurial/revset.py Fri Oct 14 23:33:00 2016 +0900
@@ -1621,7 +1621,7 @@
ps.add(cl.parentrevs(r)[0])
elif n == 2:
parents = cl.parentrevs(r)
- if len(parents) > 1:
+ if parents[1] != node.nullrev:
ps.add(parents[1])
return subset & ps
--- a/tests/test-revset.t Mon Oct 10 22:30:09 2016 +0200
+++ b/tests/test-revset.t Fri Oct 14 23:33:00 2016 +0900
@@ -2750,6 +2750,7 @@
5
$ log 'merge()^2'
4
+ $ log '(not merge())^2'
$ log 'merge()^^'
3
$ log 'merge()^1^'