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