changeset 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 e6e1884df298
children 83527d9f1f13
files mercurial/revsetlang.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
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 []