revset: drop support for '' as alias for '.'
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 02 Apr 2018 09:16:52 -0700
changeset 37264 d2c912836465
parent 37263 f74fdab86f16
child 37265 923362010525
revset: drop support for '' as alias for '.' Not marked BC because I think support for using '' on the CLI was there by accident, and we don't seem to have documented it. Differential Revision: https://phab.mercurial-scm.org/D3018
mercurial/revset.py
tests/test-revset2.t
--- a/mercurial/revset.py	Mon Apr 02 09:06:24 2018 -0700
+++ b/mercurial/revset.py	Mon Apr 02 09:16:52 2018 -0700
@@ -116,6 +116,8 @@
 # operator methods
 
 def stringset(repo, subset, x, order):
+    if not x:
+        raise error.ParseError(_("empty string is not a valid revision"))
     x = scmutil.intrev(repo[x])
     if (x in subset
         or x == node.nullrev and isinstance(subset, fullreposet)):
--- a/tests/test-revset2.t	Mon Apr 02 09:06:24 2018 -0700
+++ b/tests/test-revset2.t	Mon Apr 02 09:16:52 2018 -0700
@@ -581,7 +581,8 @@
   hg: parse error: empty query
   [255]
   $ log 'parents("")'
-  8
+  hg: parse error: empty string is not a valid revision
+  [255]
 
 we can use patterns when searching for tags