Patchwork [3,of,4] revset: 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 <2d9cedc98af1671355ad.1450893532@waste.org>
Download mbox | patch
Permalink /patch/12303/
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 1450893243 0
#      Wed Dec 23 17:54:03 2015 +0000
# Node ID 2d9cedc98af1671355ad81b360eec771382597a0
# Parent  b87c3846c54f22d270d71c42d8b80d21b51a927e
revset: add hint for list error to use or

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -448,7 +448,8 @@ 
     return subset - getset(repo, subset, x)
 
 def listset(repo, subset, 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 "revsets.x or y"'))
 
 def keyvaluepair(repo, subset, k, v):
     raise error.ParseError(_("can't use a key-value pair in this context"))
diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -1163,6 +1163,12 @@ 
   0
   -1
 
+test ',' in `_list`
+  $ log '0,1'
+  hg: parse error: can't use a list in this context
+  (see hg help "revsets.x or y")
+  [255]
+
 test that chained `or` operations make balanced addsets
 
   $ try '0:1|1:2|2:3|3:4|4:5'