##// END OF EJS Templates
template: directly instantiate diff options for diffstat
Boris Feld -
r38583:64f15e22 default
parent child Browse files
Show More
@@ -27,6 +27,7 b' from . import ('
27 util,
27 util,
28 )
28 )
29 from .utils import (
29 from .utils import (
30 diffutil,
30 stringutil,
31 stringutil,
31 )
32 )
32
33
@@ -263,7 +264,8 b' def showdiffstat(context, mapping):'
263 "modified files: +added/-removed lines"
264 "modified files: +added/-removed lines"
264 """
265 """
265 ctx = context.resource(mapping, 'ctx')
266 ctx = context.resource(mapping, 'ctx')
266 diff = ctx.diff(opts={'noprefix': False})
267 diffopts = diffutil.diffopts(ctx._repo.ui, {'noprefix': False})
268 diff = ctx.diff(opts=diffopts)
267 stats = patch.diffstatdata(util.iterlines(diff))
269 stats = patch.diffstatdata(util.iterlines(diff))
268 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
270 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
269 return '%d: +%d/-%d' % (len(stats), adds, removes)
271 return '%d: +%d/-%d' % (len(stats), adds, removes)
General Comments 0
You need to be logged in to leave comments. Login now