# HG changeset patch
# User divy@chelsio.com
# Date 1218609078 25200
# Node ID 95d1af8753229ff1bf1d970b35e3d0c9e38c883d
# Parent  077f1e637cd829ae3dfa10431d3e5d78e7567bd4
notify::diff() keeps line breaks in the diff buffer before calling
patch::diffstat().
patch::diffstat() however adds another line break when feeding diffstat input.
The added extra empty line leads to erroneous diffstat output.
This fix removes the line breaks in notify::diff() and loops through the diff
lines to print them.

diff -r 077f1e637cd8 -r 95d1af875322 hgext/notify.py
--- a/hgext/notify.py	Sun Aug 10 18:38:43 2008 -0500
+++ b/hgext/notify.py	Tue Aug 12 23:31:18 2008 -0700
@@ -235,7 +235,7 @@
         prev = self.repo.changelog.parents(node)[0]
         self.ui.pushbuffer()
         patch.diff(self.repo, prev, ref, opts=patch.diffopts(self.ui))
-        difflines = self.ui.popbuffer().splitlines(1)
+        difflines = self.ui.popbuffer().splitlines()
         if self.ui.configbool('notify', 'diffstat', True):
             s = patch.diffstat(difflines)
             # s may be nil, don't include the header if it is
@@ -249,7 +249,8 @@
             difflines = difflines[:maxdiff]
         elif difflines:
             self.ui.write(_('\ndiffs (%d lines):\n\n') % len(difflines))
-        self.ui.write(*difflines)
+        for line in difflines:
+            self.ui.write(line + "\n")
 
 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
     '''send email notifications to interested subscribers.
