# HG changeset patch # User Boris Feld # Date 1529757778 -7200 # Node ID 1770416de208ccd84f3fbfd50d2e40b0c54655df # Parent 6ec996e8c9bc074bc71d61c37110e0f7a8941437 webutil: pass a diffopts object to context.diff diff -r 6ec996e8c9bc -r 1770416de208 mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Sat Jun 23 14:37:10 2018 +0200 +++ b/mercurial/hgweb/webutil.py Sat Jun 23 14:42:58 2018 +0200 @@ -41,6 +41,7 @@ ) from ..utils import ( + diffutil, stringutil, ) @@ -206,8 +207,8 @@ return templateutil.mappinggenerator(_ctxsgen, args=(siblings,)) def difffeatureopts(req, ui, section): - diffopts = patch.difffeatureopts(ui, untrusted=True, - section=section, whitespace=True) + diffopts = diffutil.difffeatureopts(ui, untrusted=True, + section=section, whitespace=True) for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'): v = req.qsparams.get(k) @@ -657,8 +658,9 @@ def diffstatgen(ctx, basectx): '''Generator function that provides the diffstat data.''' + diffopts = patch.diffopts(ctx._repo.ui, {'noprefix': False}) stats = patch.diffstatdata( - util.iterlines(ctx.diff(basectx, opts={'noprefix': False}))) + util.iterlines(ctx.diff(basectx, opts=diffopts))) maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats) while True: yield stats, maxname, maxtotal, addtotal, removetotal, binary