revset: use 'requires' instead of 'wants' in error message
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sat, 16 Oct 2010 18:50:53 +0200
changeset 12736 7e14e67e6622
parent 12735 8888e56ac417
child 12738 e9733f96b38b
revset: use 'requires' instead of 'wants' in error message
mercurial/revset.py
tests/test-revset.t
--- a/mercurial/revset.py	Fri Oct 15 05:21:51 2010 +0200
+++ b/mercurial/revset.py	Sat Oct 16 18:50:53 2010 +0200
@@ -174,8 +174,8 @@
 # functions
 
 def node(repo, subset, x):
-    l = getargs(x, 1, 1, _("id wants one argument"))
-    n = getstring(l[0], _("id wants a string"))
+    l = getargs(x, 1, 1, _("id requires one argument"))
+    n = getstring(l[0], _("id requires a string"))
     if len(n) == 40:
         rn = repo[n].rev()
     else:
@@ -183,9 +183,9 @@
     return [r for r in subset if r == rn]
 
 def rev(repo, subset, x):
-    l = getargs(x, 1, 1, _("rev wants one argument"))
+    l = getargs(x, 1, 1, _("rev requires one argument"))
     try:
-        l = int(getstring(l[0], _("rev wants a number")))
+        l = int(getstring(l[0], _("rev requires a number")))
     except ValueError:
         raise error.ParseError(_("rev expects a number"))
     return [r for r in subset if r == l]
@@ -228,9 +228,9 @@
     return []
 
 def limit(repo, subset, x):
-    l = getargs(x, 2, 2, _("limit wants two arguments"))
+    l = getargs(x, 2, 2, _("limit requires two arguments"))
     try:
-        lim = int(getstring(l[1], _("limit wants a number")))
+        lim = int(getstring(l[1], _("limit requires a number")))
     except ValueError:
         raise error.ParseError(_("limit expects a number"))
     return getset(repo, subset, l[0])[:lim]
@@ -254,7 +254,7 @@
     return [r for r in subset if r in s or repo[r].branch() in b]
 
 def ancestor(repo, subset, x):
-    l = getargs(x, 2, 2, _("ancestor wants two arguments"))
+    l = getargs(x, 2, 2, _("ancestor requires two arguments"))
     r = range(len(repo))
     a = getset(repo, r, l[0])
     b = getset(repo, r, l[1])
@@ -285,12 +285,12 @@
     return [r for r in subset if r in s]
 
 def date(repo, subset, x):
-    ds = getstring(x, _("date wants a string"))
+    ds = getstring(x, _("date requires a string"))
     dm = util.matchdate(ds)
     return [r for r in subset if dm(repo[r].date()[0])]
 
 def keyword(repo, subset, x):
-    kw = getstring(x, _("keyword wants a string")).lower()
+    kw = getstring(x, _("keyword requires a string")).lower()
     l = []
     for r in subset:
         c = repo[r]
@@ -301,7 +301,7 @@
 
 def grep(repo, subset, x):
     try:
-        gr = re.compile(getstring(x, _("grep wants a string")))
+        gr = re.compile(getstring(x, _("grep requires a string")))
     except re.error, e:
         raise error.ParseError(_('invalid match pattern: %s') % e)
     l = []
@@ -314,11 +314,11 @@
     return l
 
 def author(repo, subset, x):
-    n = getstring(x, _("author wants a string")).lower()
+    n = getstring(x, _("author requires a string")).lower()
     return [r for r in subset if n in repo[r].user().lower()]
 
 def hasfile(repo, subset, x):
-    pat = getstring(x, _("file wants a pattern"))
+    pat = getstring(x, _("file requires a pattern"))
     m = matchmod.match(repo.root, repo.getcwd(), [pat])
     s = []
     for r in subset:
@@ -329,7 +329,7 @@
     return s
 
 def contains(repo, subset, x):
-    pat = getstring(x, _("contains wants a pattern"))
+    pat = getstring(x, _("contains requires a pattern"))
     m = matchmod.match(repo.root, repo.getcwd(), [pat])
     s = []
     if m.files() == [pat]:
@@ -373,15 +373,15 @@
     return s
 
 def modifies(repo, subset, x):
-    pat = getstring(x, _("modifies wants a pattern"))
+    pat = getstring(x, _("modifies requires a pattern"))
     return checkstatus(repo, subset, pat, 0)
 
 def adds(repo, subset, x):
-    pat = getstring(x, _("adds wants a pattern"))
+    pat = getstring(x, _("adds requires a pattern"))
     return checkstatus(repo, subset, pat, 1)
 
 def removes(repo, subset, x):
-    pat = getstring(x, _("removes wants a pattern"))
+    pat = getstring(x, _("removes requires a pattern"))
     return checkstatus(repo, subset, pat, 2)
 
 def merge(repo, subset, x):
@@ -412,7 +412,7 @@
         return []
 
 def sort(repo, subset, x):
-    l = getargs(x, 1, 2, _("sort wants one or two arguments"))
+    l = getargs(x, 1, 2, _("sort requires one or two arguments"))
     keys = "rev"
     if len(l) == 2:
         keys = getstring(l[1], _("sort spec must be a string"))
@@ -469,8 +469,8 @@
 
 def outgoing(repo, subset, x):
     import hg # avoid start-up nasties
-    l = getargs(x, 0, 1, _("outgoing wants a repository path"))
-    dest = l and getstring(l[0], _("outgoing wants a repository path")) or ''
+    l = getargs(x, 0, 1, _("outgoing requires a repository path"))
+    dest = l and getstring(l[0], _("outgoing requires a repository path")) or ''
     dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
     dest, branches = hg.parseurl(dest)
     revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
--- a/tests/test-revset.t	Fri Oct 15 05:21:51 2010 +0200
+++ b/tests/test-revset.t	Sat Oct 16 18:50:53 2010 +0200
@@ -148,7 +148,7 @@
   hg: parse error at 10: unexpected token: symbol
   [255]
   $ log 'date()'
-  hg: parse error: date wants a string
+  hg: parse error: date requires a string
   [255]
   $ log 'date'
   hg: parse error: can't use date here
@@ -166,7 +166,7 @@
   4
 
   $ log 'ancestor(1)'
-  hg: parse error: ancestor wants two arguments
+  hg: parse error: ancestor requires two arguments
   [255]
   $ log 'ancestor(4,5)'
   1