mercurial/hgweb/webutil.py
changeset 34403 407ebe7a9b93
parent 34390 f6492f482c60
child 34807 3caec3c032c8
--- a/mercurial/hgweb/webutil.py	Sun Oct 01 14:02:47 2017 +0100
+++ b/mercurial/hgweb/webutil.py	Sun Oct 01 12:29:33 2017 +0100
@@ -177,12 +177,8 @@
     for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
         v = req.form.get(k, [None])[0]
         if v is not None:
-            try:
-                v = bool(int(v))
-            except ValueError:
-                v = True
-
-            setattr(diffopts, k, v)
+            v = util.parsebool(v)
+            setattr(diffopts, k, v if v is not None else True)
 
     return diffopts