mercurial/hgweb/webutil.py
changeset 34391 f6492f482c60
parent 34253 db63872e10cc
child 34404 407ebe7a9b93
equal deleted inserted replaced
34390:e16ad1576d71 34391:f6492f482c60
   168             yield d
   168             yield d
   169 
   169 
   170     def __len__(self):
   170     def __len__(self):
   171         return len(self.siblings)
   171         return len(self.siblings)
   172 
   172 
   173 def annotate(fctx, ui):
   173 def difffeatureopts(req, ui, section):
   174     diffopts = patch.difffeatureopts(ui, untrusted=True,
   174     diffopts = patch.difffeatureopts(ui, untrusted=True,
   175                                      section='annotate', whitespace=True)
   175                                      section=section, whitespace=True)
       
   176 
       
   177     for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
       
   178         v = req.form.get(k, [None])[0]
       
   179         if v is not None:
       
   180             try:
       
   181                 v = bool(int(v))
       
   182             except ValueError:
       
   183                 v = True
       
   184 
       
   185             setattr(diffopts, k, v)
       
   186 
       
   187     return diffopts
       
   188 
       
   189 def annotate(req, fctx, ui):
       
   190     diffopts = difffeatureopts(req, ui, 'annotate')
   176     return fctx.annotate(follow=True, linenumber=True, diffopts=diffopts)
   191     return fctx.annotate(follow=True, linenumber=True, diffopts=diffopts)
   177 
   192 
   178 def parents(ctx, hide=None):
   193 def parents(ctx, hide=None):
   179     if isinstance(ctx, context.basefilectx):
   194     if isinstance(ctx, context.basefilectx):
   180         introrev = ctx.introrev()
   195         introrev = ctx.introrev()