# HG changeset patch # User Matt Mackall # Date 2010-06-19 18:00:08 # Node ID 42408cd43f55be6d24ada3a41bc4261b15c94384 # Parent bf5d88c466e0bc5632c8d54a0d408d81eb9e366b revset: fix up contains/getstring when no args passed diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -87,7 +87,7 @@ def tokenize(program): # 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 @@ def hasfile(repo, subset, x): 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]: