--- a/mercurial/cmdutil.py Mon Mar 23 13:15:57 2009 +0100
+++ b/mercurial/cmdutil.py Mon Mar 23 10:41:42 2009 +0100
@@ -830,6 +830,15 @@
node=hex(ctx.changeset()[0])))
return self.t('manifest', **args)
+ def showdiffstat(**args):
+ diff = patch.diff(self.repo, ctx.parents()[0].node(), ctx.node())
+ files, adds, removes = 0, 0, 0
+ for i in patch.diffstatdata(util.iterlines(diff)):
+ files += 1
+ adds += i[1]
+ removes += i[2]
+ return '%s: +%s/-%s' % (files, adds, removes)
+
defprops = {
'author': ctx.user(),
'branches': showbranches,
@@ -846,6 +855,7 @@
'rev': ctx.rev(),
'tags': showtags,
'extras': showextras,
+ 'diffstat': showdiffstat,
}
props = props.copy()
props.update(defprops)