[PATCH 3 of 5] revset: make "null" able to appear in internal _list() expression

Yuya Nishihara yuya at tcha.org
Fri May 29 09:38:06 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1432902660 -32400
#      Fri May 29 21:31:00 2015 +0900
# Node ID a965eb455f7803702865fdac7ebfeff03f1d5a80
# Parent  5be635444c0156a6d0688d5ba3688a9a9db7f561
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.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1928,7 +1928,8 @@ def _list(repo, subset, x):
         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)


More information about the Mercurial-devel mailing list