mercurial/templatekw.py
changeset 30811 cf1e15f91c90
parent 30712 5dde81de1e6d
child 30833 bd5e9647f646
equal deleted inserted replaced
30810:df5d3734b3df 30811:cf1e15f91c90
   297 @templatekeyword('diffstat')
   297 @templatekeyword('diffstat')
   298 def showdiffstat(repo, ctx, templ, **args):
   298 def showdiffstat(repo, ctx, templ, **args):
   299     """String. Statistics of changes with the following format:
   299     """String. Statistics of changes with the following format:
   300     "modified files: +added/-removed lines"
   300     "modified files: +added/-removed lines"
   301     """
   301     """
   302     stats = patch.diffstatdata(util.iterlines(ctx.diff()))
   302     stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
   303     maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
   303     maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
   304     return '%s: +%s/-%s' % (len(stats), adds, removes)
   304     return '%s: +%s/-%s' % (len(stats), adds, removes)
   305 
   305 
   306 @templatekeyword('extras')
   306 @templatekeyword('extras')
   307 def showextras(**args):
   307 def showextras(**args):