# HG changeset patch # User Denis Laxalde # Date 2017-04-15 09:26:09 # Node ID 11f501f0a2136126aa4280c29929a246825d5424 # Parent e6e1884df298da74c2a3ce77ae88483b94ad42d4 revsetlang: add a getboolean helper function This will be used to parse followlines's "descend" argument. diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py --- a/mercurial/revsetlang.py +++ b/mercurial/revsetlang.py @@ -199,6 +199,12 @@ def getinteger(x, err, default=_notset): except ValueError: raise error.ParseError(err) +def getboolean(x, err): + value = util.parsebool(getsymbol(x)) + if value is not None: + return value + raise error.ParseError(err) + def getlist(x): if not x: return []