# HG changeset patch # User Matt Mackall # Date 1276970408 18000 # Node ID 42408cd43f55be6d24ada3a41bc4261b15c94384 # Parent bf5d88c466e0bc5632c8d54a0d408d81eb9e366b revset: fix up contains/getstring when no args passed diff -r bf5d88c466e0 -r 42408cd43f55 mercurial/revset.py --- a/mercurial/revset.py Sat Jun 19 13:00:01 2010 -0500 +++ b/mercurial/revset.py Sat Jun 19 13:00:08 2010 -0500 @@ -87,7 +87,7 @@ # helpers def getstring(x, err): - if x[0] == 'string' or x[0] == 'symbol': + if x and (x[0] == 'string' or x[0] == 'symbol'): return x[1] raise error.ParseError(err) @@ -278,7 +278,7 @@ return s def contains(repo, subset, x): - pat = getstring(x, _("file wants a pattern")) + pat = getstring(x, _("contains wants a pattern")) m = _match.match(repo.root, repo.getcwd(), [pat]) s = [] if m.files() == [pat]: