notify: print diffstat even if maxline == 0
authorBenoît Allard <benoit@aeteurope.nl>
Thu, 20 Mar 2008 16:42:51 +0100
changeset 6305 e8d447d91cdb
parent 6304 d99b4e8652b3
child 6306 2f9de4aaea9e
notify: print diffstat even if maxline == 0
hgext/notify.py
--- a/hgext/notify.py	Thu Mar 20 01:47:35 2008 +0100
+++ b/hgext/notify.py	Thu Mar 20 16:42:51 2008 +0100
@@ -234,8 +234,6 @@
 
     def diff(self, node, ref):
         maxdiff = int(self.ui.config('notify', 'maxdiff', 300))
-        if maxdiff == 0:
-            return
         prev = self.repo.changelog.parents(node)[0]
         self.ui.pushbuffer()
         patch.diff(self.repo, prev, ref)
@@ -245,6 +243,8 @@
             # s may be nil, don't include the header if it is
             if s:
                 self.ui.write('\ndiffstat:\n\n%s' % s)
+        if maxdiff == 0:
+            return
         if maxdiff > 0 and len(difflines) > maxdiff:
             self.ui.write(_('\ndiffs (truncated from %d to %d lines):\n\n') %
                           (len(difflines), maxdiff))