notify changeset diff should be against current node instead of tip
author"Aurelien Jacobs <aurel@gnuage.org>"
Tue, 16 May 2006 14:17:45 -0700
changeset 2296 6e8e3dd7976e
parent 2295 9c15f85e61b1
child 2297 936b615eb44e
notify changeset diff should be against current node instead of tip
hgext/notify.py
--- a/hgext/notify.py	Tue May 16 11:07:56 2006 +0200
+++ b/hgext/notify.py	Tue May 16 14:17:45 2006 -0700
@@ -228,14 +228,13 @@
             mail = self.ui.sendmail()
             mail.sendmail(templater.email(msg['From']), self.subs, msgtext)
 
-    def diff(self, node):
+    def diff(self, node, ref):
         maxdiff = int(self.ui.config('notify', 'maxdiff', 300))
         if maxdiff == 0:
             return
         fp = templater.stringio()
         prev = self.repo.changelog.parents(node)[0]
-        commands.dodiff(fp, self.ui, self.repo, prev,
-                        self.repo.changelog.tip())
+        commands.dodiff(fp, self.ui, self.repo, prev, ref)
         difflines = fp.getvalue().splitlines(1)
         if maxdiff > 0 and len(difflines) > maxdiff:
             self.sio.write(_('\ndiffs (truncated from %d to %d lines):\n\n') %
@@ -260,8 +259,9 @@
         count = end - start
         for rev in xrange(start, end):
             n.node(repo.changelog.node(rev))
+        n.diff(node, repo.changelog.tip())
     else:
         count = 1
         n.node(node)
-    n.diff(node)
+        n.diff(node, node)
     n.send(node, count)