261 def showdiffstat(context, mapping): |
262 def showdiffstat(context, mapping): |
262 """String. Statistics of changes with the following format: |
263 """String. Statistics of changes with the following format: |
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) |
270 |
272 |
271 @templatekeyword('envvars', requires={'ui'}) |
273 @templatekeyword('envvars', requires={'ui'}) |