revset: remove nullrev from set computed in p1() and p2()
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 17 Sep 2014 04:40:30 -0700
changeset 22495 668b26d32bf6
parent 22494 14f6cebfcb8a
child 22496 35af9361a049
revset: remove nullrev from set computed in p1() and p2() The old code relied on the subset contents to get rid of invalid values. We would like to be able to rely more on the computation in p1() and p2() so we filter out the invalid value
mercurial/revset.py
--- a/mercurial/revset.py	Tue Sep 16 23:42:41 2014 -0700
+++ b/mercurial/revset.py	Wed Sep 17 04:40:30 2014 -0700
@@ -1204,6 +1204,7 @@
     cl = repo.changelog
     for r in getset(repo, spanset(repo), x):
         ps.add(cl.parentrevs(r)[0])
+    ps -= set([node.nullrev])
     return subset & ps
 
 def p2(repo, subset, x):
@@ -1222,6 +1223,7 @@
     cl = repo.changelog
     for r in getset(repo, spanset(repo), x):
         ps.add(cl.parentrevs(r)[1])
+    ps -= set([node.nullrev])
     return subset & ps
 
 def parents(repo, subset, x):