##// END OF EJS Templates
revset: use 'requires' instead of 'wants' in error message
Benoit Boissinot -
r12736:7e14e67e default
parent child Browse files
Show More
@@ -174,8 +174,8 b' def func(repo, subset, a, b):'
174 # functions
174 # functions
175
175
176 def node(repo, subset, x):
176 def node(repo, subset, x):
177 l = getargs(x, 1, 1, _("id wants one argument"))
177 l = getargs(x, 1, 1, _("id requires one argument"))
178 n = getstring(l[0], _("id wants a string"))
178 n = getstring(l[0], _("id requires a string"))
179 if len(n) == 40:
179 if len(n) == 40:
180 rn = repo[n].rev()
180 rn = repo[n].rev()
181 else:
181 else:
@@ -183,9 +183,9 b' def node(repo, subset, x):'
183 return [r for r in subset if r == rn]
183 return [r for r in subset if r == rn]
184
184
185 def rev(repo, subset, x):
185 def rev(repo, subset, x):
186 l = getargs(x, 1, 1, _("rev wants one argument"))
186 l = getargs(x, 1, 1, _("rev requires one argument"))
187 try:
187 try:
188 l = int(getstring(l[0], _("rev wants a number")))
188 l = int(getstring(l[0], _("rev requires a number")))
189 except ValueError:
189 except ValueError:
190 raise error.ParseError(_("rev expects a number"))
190 raise error.ParseError(_("rev expects a number"))
191 return [r for r in subset if r == l]
191 return [r for r in subset if r == l]
@@ -228,9 +228,9 b' def minrev(repo, subset, x):'
228 return []
228 return []
229
229
230 def limit(repo, subset, x):
230 def limit(repo, subset, x):
231 l = getargs(x, 2, 2, _("limit wants two arguments"))
231 l = getargs(x, 2, 2, _("limit requires two arguments"))
232 try:
232 try:
233 lim = int(getstring(l[1], _("limit wants a number")))
233 lim = int(getstring(l[1], _("limit requires a number")))
234 except ValueError:
234 except ValueError:
235 raise error.ParseError(_("limit expects a number"))
235 raise error.ParseError(_("limit expects a number"))
236 return getset(repo, subset, l[0])[:lim]
236 return getset(repo, subset, l[0])[:lim]
@@ -254,7 +254,7 b' def branch(repo, subset, x):'
254 return [r for r in subset if r in s or repo[r].branch() in b]
254 return [r for r in subset if r in s or repo[r].branch() in b]
255
255
256 def ancestor(repo, subset, x):
256 def ancestor(repo, subset, x):
257 l = getargs(x, 2, 2, _("ancestor wants two arguments"))
257 l = getargs(x, 2, 2, _("ancestor requires two arguments"))
258 r = range(len(repo))
258 r = range(len(repo))
259 a = getset(repo, r, l[0])
259 a = getset(repo, r, l[0])
260 b = getset(repo, r, l[1])
260 b = getset(repo, r, l[1])
@@ -285,12 +285,12 b' def follow(repo, subset, x):'
285 return [r for r in subset if r in s]
285 return [r for r in subset if r in s]
286
286
287 def date(repo, subset, x):
287 def date(repo, subset, x):
288 ds = getstring(x, _("date wants a string"))
288 ds = getstring(x, _("date requires a string"))
289 dm = util.matchdate(ds)
289 dm = util.matchdate(ds)
290 return [r for r in subset if dm(repo[r].date()[0])]
290 return [r for r in subset if dm(repo[r].date()[0])]
291
291
292 def keyword(repo, subset, x):
292 def keyword(repo, subset, x):
293 kw = getstring(x, _("keyword wants a string")).lower()
293 kw = getstring(x, _("keyword requires a string")).lower()
294 l = []
294 l = []
295 for r in subset:
295 for r in subset:
296 c = repo[r]
296 c = repo[r]
@@ -301,7 +301,7 b' def keyword(repo, subset, x):'
301
301
302 def grep(repo, subset, x):
302 def grep(repo, subset, x):
303 try:
303 try:
304 gr = re.compile(getstring(x, _("grep wants a string")))
304 gr = re.compile(getstring(x, _("grep requires a string")))
305 except re.error, e:
305 except re.error, e:
306 raise error.ParseError(_('invalid match pattern: %s') % e)
306 raise error.ParseError(_('invalid match pattern: %s') % e)
307 l = []
307 l = []
@@ -314,11 +314,11 b' def grep(repo, subset, x):'
314 return l
314 return l
315
315
316 def author(repo, subset, x):
316 def author(repo, subset, x):
317 n = getstring(x, _("author wants a string")).lower()
317 n = getstring(x, _("author requires a string")).lower()
318 return [r for r in subset if n in repo[r].user().lower()]
318 return [r for r in subset if n in repo[r].user().lower()]
319
319
320 def hasfile(repo, subset, x):
320 def hasfile(repo, subset, x):
321 pat = getstring(x, _("file wants a pattern"))
321 pat = getstring(x, _("file requires a pattern"))
322 m = matchmod.match(repo.root, repo.getcwd(), [pat])
322 m = matchmod.match(repo.root, repo.getcwd(), [pat])
323 s = []
323 s = []
324 for r in subset:
324 for r in subset:
@@ -329,7 +329,7 b' def hasfile(repo, subset, x):'
329 return s
329 return s
330
330
331 def contains(repo, subset, x):
331 def contains(repo, subset, x):
332 pat = getstring(x, _("contains wants a pattern"))
332 pat = getstring(x, _("contains requires a pattern"))
333 m = matchmod.match(repo.root, repo.getcwd(), [pat])
333 m = matchmod.match(repo.root, repo.getcwd(), [pat])
334 s = []
334 s = []
335 if m.files() == [pat]:
335 if m.files() == [pat]:
@@ -373,15 +373,15 b' def checkstatus(repo, subset, pat, field'
373 return s
373 return s
374
374
375 def modifies(repo, subset, x):
375 def modifies(repo, subset, x):
376 pat = getstring(x, _("modifies wants a pattern"))
376 pat = getstring(x, _("modifies requires a pattern"))
377 return checkstatus(repo, subset, pat, 0)
377 return checkstatus(repo, subset, pat, 0)
378
378
379 def adds(repo, subset, x):
379 def adds(repo, subset, x):
380 pat = getstring(x, _("adds wants a pattern"))
380 pat = getstring(x, _("adds requires a pattern"))
381 return checkstatus(repo, subset, pat, 1)
381 return checkstatus(repo, subset, pat, 1)
382
382
383 def removes(repo, subset, x):
383 def removes(repo, subset, x):
384 pat = getstring(x, _("removes wants a pattern"))
384 pat = getstring(x, _("removes requires a pattern"))
385 return checkstatus(repo, subset, pat, 2)
385 return checkstatus(repo, subset, pat, 2)
386
386
387 def merge(repo, subset, x):
387 def merge(repo, subset, x):
@@ -412,7 +412,7 b' def present(repo, subset, x):'
412 return []
412 return []
413
413
414 def sort(repo, subset, x):
414 def sort(repo, subset, x):
415 l = getargs(x, 1, 2, _("sort wants one or two arguments"))
415 l = getargs(x, 1, 2, _("sort requires one or two arguments"))
416 keys = "rev"
416 keys = "rev"
417 if len(l) == 2:
417 if len(l) == 2:
418 keys = getstring(l[1], _("sort spec must be a string"))
418 keys = getstring(l[1], _("sort spec must be a string"))
@@ -469,8 +469,8 b' def roots(repo, subset, x):'
469
469
470 def outgoing(repo, subset, x):
470 def outgoing(repo, subset, x):
471 import hg # avoid start-up nasties
471 import hg # avoid start-up nasties
472 l = getargs(x, 0, 1, _("outgoing wants a repository path"))
472 l = getargs(x, 0, 1, _("outgoing requires a repository path"))
473 dest = l and getstring(l[0], _("outgoing wants a repository path")) or ''
473 dest = l and getstring(l[0], _("outgoing requires a repository path")) or ''
474 dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
474 dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
475 dest, branches = hg.parseurl(dest)
475 dest, branches = hg.parseurl(dest)
476 revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
476 revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
@@ -148,7 +148,7 b' quoting needed'
148 hg: parse error at 10: unexpected token: symbol
148 hg: parse error at 10: unexpected token: symbol
149 [255]
149 [255]
150 $ log 'date()'
150 $ log 'date()'
151 hg: parse error: date wants a string
151 hg: parse error: date requires a string
152 [255]
152 [255]
153 $ log 'date'
153 $ log 'date'
154 hg: parse error: can't use date here
154 hg: parse error: can't use date here
@@ -166,7 +166,7 b' quoting needed'
166 4
166 4
167
167
168 $ log 'ancestor(1)'
168 $ log 'ancestor(1)'
169 hg: parse error: ancestor wants two arguments
169 hg: parse error: ancestor requires two arguments
170 [255]
170 [255]
171 $ log 'ancestor(4,5)'
171 $ log 'ancestor(4,5)'
172 1
172 1
General Comments 0
You need to be logged in to leave comments. Login now