##// END OF EJS Templates
webutil: pass a diffopts object to context.diff
Boris Feld -
r38585:1770416d default
parent child Browse files
Show More
@@ -41,6 +41,7 b' from .. import ('
41 )
41 )
42
42
43 from ..utils import (
43 from ..utils import (
44 diffutil,
44 stringutil,
45 stringutil,
45 )
46 )
46
47
@@ -206,8 +207,8 b' def _siblings(siblings=None, hiderev=Non'
206 return templateutil.mappinggenerator(_ctxsgen, args=(siblings,))
207 return templateutil.mappinggenerator(_ctxsgen, args=(siblings,))
207
208
208 def difffeatureopts(req, ui, section):
209 def difffeatureopts(req, ui, section):
209 diffopts = patch.difffeatureopts(ui, untrusted=True,
210 diffopts = diffutil.difffeatureopts(ui, untrusted=True,
210 section=section, whitespace=True)
211 section=section, whitespace=True)
211
212
212 for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
213 for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
213 v = req.qsparams.get(k)
214 v = req.qsparams.get(k)
@@ -657,8 +658,9 b' def compare(contextnum, leftlines, right'
657 def diffstatgen(ctx, basectx):
658 def diffstatgen(ctx, basectx):
658 '''Generator function that provides the diffstat data.'''
659 '''Generator function that provides the diffstat data.'''
659
660
661 diffopts = patch.diffopts(ctx._repo.ui, {'noprefix': False})
660 stats = patch.diffstatdata(
662 stats = patch.diffstatdata(
661 util.iterlines(ctx.diff(basectx, opts={'noprefix': False})))
663 util.iterlines(ctx.diff(basectx, opts=diffopts)))
662 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
664 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
663 while True:
665 while True:
664 yield stats, maxname, maxtotal, addtotal, removetotal, binary
666 yield stats, maxname, maxtotal, addtotal, removetotal, binary
General Comments 0
You need to be logged in to leave comments. Login now