fileset: add hint for list error to use or
authortimeless <timeless@mozdev.org>
Wed, 23 Dec 2015 17:54:13 +0000
changeset 27518 737ffdabbde9
parent 27517 c60a9c16ae25
child 27519 f4517c88ab81
fileset: add hint for list error to use or
mercurial/fileset.py
tests/test-fileset.t
--- a/mercurial/fileset.py	Wed Dec 23 17:54:03 2015 +0000
+++ b/mercurial/fileset.py	Wed Dec 23 17:54:13 2015 +0000
@@ -128,7 +128,8 @@
     return [f for f in xl if f not in yl]
 
 def listset(mctx, a, b):
-    raise error.ParseError(_("can't use a list in this context"))
+    raise error.ParseError(_("can't use a list in this context"),
+                           hint=_('see hg help "filesets.x or y"'))
 
 # symbols are callable like:
 #  fun(mctx, x)
--- a/tests/test-fileset.t	Wed Dec 23 17:54:03 2015 +0000
+++ b/tests/test-fileset.t	Wed Dec 23 17:54:13 2015 +0000
@@ -135,6 +135,10 @@
   $ fileset 'size("bar")'
   hg: parse error: couldn't parse size: bar
   [255]
+  $ fileset '(1k, 2k)'
+  hg: parse error: can't use a list in this context
+  (see hg help "filesets.x or y")
+  [255]
   $ fileset 'size(1k)'
   1k
   $ fileset '(1k or 2k) and size("< 2k")'