[PATCH] templatekw.showdiffstat: use ctx.diff() instead of calling patch

Alexander Solovyov alexander at solovyov.net
Tue Dec 7 08:51:13 CST 2010


# HG changeset patch
# User Alexander Solovyov <alexander at solovyov.net>
# Date 1291733428 -3600
# Node ID bd15a88c962a3816b6aa424aeeadd629d8fc7a56
# Parent  ea190e7ddffdbe601cbac12dcaa106450f48be45
templatekw.showdiffstat: use ctx.diff() instead of calling patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -162,9 +162,8 @@ def showdescription(repo, ctx, templ, **
     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]


More information about the Mercurial-devel mailing list