mercurial/hgweb/webutil.py
changeset 34390 f6492f482c60
parent 34246 db63872e10cc
child 34403 407ebe7a9b93
--- a/mercurial/hgweb/webutil.py	Sat Sep 30 09:07:00 2017 +0100
+++ b/mercurial/hgweb/webutil.py	Sat Sep 30 09:08:01 2017 +0100
@@ -170,9 +170,24 @@
     def __len__(self):
         return len(self.siblings)
 
-def annotate(fctx, ui):
+def difffeatureopts(req, ui, section):
     diffopts = patch.difffeatureopts(ui, untrusted=True,
-                                     section='annotate', whitespace=True)
+                                     section=section, whitespace=True)
+
+    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)
+
+    return diffopts
+
+def annotate(req, fctx, ui):
+    diffopts = difffeatureopts(req, ui, 'annotate')
     return fctx.annotate(follow=True, linenumber=True, diffopts=diffopts)
 
 def parents(ctx, hide=None):