diff -r 689f6cdccef5 -r 407ebe7a9b93 mercurial/hgweb/webutil.py --- 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