revset: make "null" able to appear in internal _list() expression
authorYuya Nishihara <yuya@tcha.org>
Fri, 29 May 2015 21:31:00 +0900
changeset 25342 5dde117269b6
parent 25341 9d6cc87bd507
child 25343 7fbef7932af9
revset: make "null" able to appear in internal _list() expression This is the same workaround introduced at e16456831516. Without this patch, "null or x" can't be optimized to _list(null x). Test case will be added by the next patch.
mercurial/revset.py
--- a/mercurial/revset.py	Sun May 24 14:49:41 2015 +0900
+++ b/mercurial/revset.py	Fri May 29 21:31:00 2015 +0900
@@ -1928,7 +1928,8 @@
         r = repo[t].rev()
         if r in seen:
             continue
-        if r in subset:
+        if (r in subset
+            or r == node.nullrev and isinstance(subset, fullreposet)):
             ls.append(r)
         seen.add(r)
     return baseset(ls)