[PATCH RFC] revset: completely ignore "null" symbol in new-style query (BC)

Yuya Nishihara yuya at tcha.org
Sun Jan 4 03:21:07 UTC 2015


This depends on my previous patch "revset: drop pre-lazyset optimization for
stringset of subset == entire repo."  I want to know if "null" revision is
supported in revset.

# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1420338954 -32400
#      Sun Jan 04 11:35:54 2015 +0900
# Branch stable
# Node ID 144888bd0388a9ebf12d72ce3ea5d3f347fb6b8e
# Parent  e96450f354b1b693385d9cd1e1374fa910e1bf5f
revset: completely ignore "null" symbol in new-style query (BC)

I'm confused about the current state of "null" revision in revset.  Should we
fix "len(subset) == len(repo)" so that at least "null::" can be used with
evolve-enabled repository?

test-mq.t is updated not to use "null::".

correct (old-style query handled by scmutil.revrange):
 % hg log -r null                => (-1,)
 % hg log -r null:               => (-1, 0, 1, ...)

correct if no hidden revision exists (i.e. len(subset) == len(repo)):
 % hg log -r null::              => (-1, 0, 1, ...)
 % hg log -r 'null:: and null::' => (-1, 0, 1, ...)

incorrect:
 % hg log -r 'null: and null:'   => (0, 1, 2, ...)
 % hg log -r 'first(null:)'      => (0,)
 % hg log -r 'first(null::)'     => ()

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -253,8 +253,6 @@ def _getrevsource(repo, r):
 
 def stringset(repo, subset, x):
     x = repo[x].rev()
-    if x == -1 and len(subset) == len(repo):
-        return baseset([-1])
     if x in subset:
         return baseset([x])
     return baseset()
diff --git a/tests/test-mq.t b/tests/test-mq.t
--- a/tests/test-mq.t
+++ b/tests/test-mq.t
@@ -1508,7 +1508,7 @@ Proper phase default with mq:
 1. mq.secret=false
 
   $ rm .hg/store/phaseroots
-  $ hg phase 'qparent::'
+  $ hg phase 'qparent:'
   -1: public
   0: draft
   1: draft
@@ -1516,7 +1516,7 @@ 1. mq.secret=false
   $ echo '[mq]' >> $HGRCPATH
   $ echo 'secret=true' >> $HGRCPATH
   $ rm -f .hg/store/phaseroots
-  $ hg phase 'qparent::'
+  $ hg phase 'qparent:'
   -1: public
   0: secret
   1: secret



More information about the Mercurial-devel mailing list