changeset 37264:d2c912836465

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
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 02 Apr 2018 09:16:52 -0700
parents f74fdab86f16
children 923362010525
files mercurial/revset.py tests/test-revset2.t
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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