mercurial/templatekw.py
changeset 14403 2c9f5897d4b7
parent 14318 1f46be4689ed
child 14437 cbe13e6bdc34
--- a/mercurial/templatekw.py	Sat May 21 15:06:38 2011 -0500
+++ b/mercurial/templatekw.py	Sat May 21 15:09:15 2011 -0500
@@ -185,12 +185,9 @@
     """:diffstat: String. Statistics of changes with the following format:
     "modified files: +added/-removed lines"
     """
-    files, adds, removes = 0, 0, 0
-    for i in patch.diffstatdata(util.iterlines(ctx.diff())):
-        files += 1
-        adds += i[1]
-        removes += i[2]
-    return '%s: +%s/-%s' % (files, adds, removes)
+    stats = patch.diffstatdata(util.iterlines(ctx.diff()))
+    maxname, adds, removes, binary = patch.diffstatsum(stats)
+    return '%s: +%s/-%s' % (len(stats), adds, removes)
 
 def showextras(**args):
     templ = args['templ']