Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revsetlang.py @ 31997:11f501f0a213
revsetlang: add a getboolean helper function
This will be used to parse followlines's "descend" argument.
author | Denis Laxalde <denis@laxalde.org> |
---|---|
date | Sat, 15 Apr 2017 11:26:09 +0200 |
parents | c63cb2d10d6d |
children | bd872f64a8ba |
line wrap: on
line diff
--- a/mercurial/revsetlang.py Tue Mar 28 10:15:02 2017 +0200 +++ b/mercurial/revsetlang.py Sat Apr 15 11:26:09 2017 +0200 @@ -199,6 +199,12 @@ 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 []