Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 11406:42408cd43f55
revset: fix up contains/getstring when no args passed
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 19 Jun 2010 13:00:08 -0500 |
parents | 37cbedbeae96 |
children | 0f623839a5cc |
comparison
equal
deleted
inserted
replaced
11405:bf5d88c466e0 | 11406:42408cd43f55 |
---|---|
85 yield ('end', None, pos) | 85 yield ('end', None, pos) |
86 | 86 |
87 # helpers | 87 # helpers |
88 | 88 |
89 def getstring(x, err): | 89 def getstring(x, err): |
90 if x[0] == 'string' or x[0] == 'symbol': | 90 if x and (x[0] == 'string' or x[0] == 'symbol'): |
91 return x[1] | 91 return x[1] |
92 raise error.ParseError(err) | 92 raise error.ParseError(err) |
93 | 93 |
94 def getlist(x): | 94 def getlist(x): |
95 if not x: | 95 if not x: |
276 s.append(r) | 276 s.append(r) |
277 continue | 277 continue |
278 return s | 278 return s |
279 | 279 |
280 def contains(repo, subset, x): | 280 def contains(repo, subset, x): |
281 pat = getstring(x, _("file wants a pattern")) | 281 pat = getstring(x, _("contains wants a pattern")) |
282 m = _match.match(repo.root, repo.getcwd(), [pat]) | 282 m = _match.match(repo.root, repo.getcwd(), [pat]) |
283 s = [] | 283 s = [] |
284 if m.files() == [pat]: | 284 if m.files() == [pat]: |
285 for r in subset: | 285 for r in subset: |
286 if pat in repo[r]: | 286 if pat in repo[r]: |