changeset 13114:8f29a08e7bbc

templatekw.showdiffstat: use ctx.diff() instead of calling patch
author Alexander Solovyov <alexander@solovyov.net>
date Tue, 07 Dec 2010 15:50:28 +0100
parents a98a90023261
children bda5f35fbf67
files mercurial/templatekw.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatekw.py	Fri Dec 10 16:10:14 2010 +0100
+++ b/mercurial/templatekw.py	Tue Dec 07 15:50:28 2010 +0100
@@ -162,9 +162,8 @@
     return ctx.description().strip()
 
 def showdiffstat(repo, ctx, templ, **args):
-    diff = patch.diff(repo, ctx.parents()[0].node(), ctx.node())
     files, adds, removes = 0, 0, 0
-    for i in patch.diffstatdata(util.iterlines(diff)):
+    for i in patch.diffstatdata(util.iterlines(ctx.diff())):
         files += 1
         adds += i[1]
         removes += i[2]