Patchwork [4,of,4] fileset: add hint for list error to use or

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 23, 2015, 5:58 p.m.
Message ID <aa1aafd4679f0508ffdb.1450893533@waste.org>
Download mbox | patch
Permalink /patch/12304/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

timeless@mozdev.org - Dec. 23, 2015, 5:58 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450893253 0
#      Wed Dec 23 17:54:13 2015 +0000
# Node ID aa1aafd4679f0508ffdb5bd5f7ef0b909ae179ad
# Parent  2d9cedc98af1671355ad81b360eec771382597a0
fileset: add hint for list error to use or

Patch

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -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)
diff --git a/tests/test-fileset.t b/tests/test-fileset.t
--- a/tests/test-fileset.t
+++ b/tests/test-fileset.t
@@ -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")'