# HG changeset patch # User Boris Feld # Date 2018-06-23 12:30:31 # Node ID 64f15e22f4f87d80bcd9850af58b50e4f1f3c066 # Parent b9724978633ea0b8507dd8023ec79a255a8227be template: directly instantiate diff options for diffstat diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -27,6 +27,7 @@ from . import ( util, ) from .utils import ( + diffutil, stringutil, ) @@ -263,7 +264,8 @@ def showdiffstat(context, mapping): "modified files: +added/-removed lines" """ ctx = context.resource(mapping, 'ctx') - diff = ctx.diff(opts={'noprefix': False}) + diffopts = diffutil.diffopts(ctx._repo.ui, {'noprefix': False}) + diff = ctx.diff(opts=diffopts) stats = patch.diffstatdata(util.iterlines(diff)) maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats) return '%d: +%d/-%d' % (len(stats), adds, removes)