# HG changeset patch # User Benoit Boissinot # Date 2010-10-16 16:50:53 # Node ID 7e14e67e6622ea7356ab313a5497fcee74a8d007 # Parent 8888e56ac4171d34960348a9ba0043317907fe4e revset: use 'requires' instead of 'wants' in error message diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -174,8 +174,8 @@ def func(repo, subset, a, b): # 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 @@ def node(repo, subset, x): 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 @@ def minrev(repo, subset, x): 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 @@ def branch(repo, subset, x): 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 @@ def follow(repo, subset, x): 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 keyword(repo, subset, x): 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 @@ def grep(repo, subset, x): 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 @@ def hasfile(repo, subset, x): 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 @@ def checkstatus(repo, subset, pat, field 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 @@ def present(repo, subset, x): 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 roots(repo, subset, x): 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, []) diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -148,7 +148,7 @@ quoting needed 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 @@ quoting needed 4 $ log 'ancestor(1)' - hg: parse error: ancestor wants two arguments + hg: parse error: ancestor requires two arguments [255] $ log 'ancestor(4,5)' 1