##// END OF EJS Templates
revset: fix up contains/getstring when no args passed
Matt Mackall -
r11406:42408cd4 default
parent child Browse files
Show More
@@ -87,7 +87,7 b' def tokenize(program):'
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
@@ -278,7 +278,7 b' def hasfile(repo, subset, x):'
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]:
General Comments 0
You need to be logged in to leave comments. Login now