changeset 4077:1305ba7dee88

Prevent type exception on concatenation if diffstat returns None. This will most often occur if diffstat is not installed in the target platform, though may also happen in other cases where diffstat fails to execute. Signed-off-by: Sean Dague <sean@dague.net>
author Sean Dague <sean@dague.net>
date Tue, 30 Jan 2007 10:35:25 -0500
parents 5a89c61c189c
children ff08cebcd116
files hgext/notify.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/notify.py	Tue Feb 13 06:50:00 2007 -0200
+++ b/hgext/notify.py	Tue Jan 30 10:35:25 2007 -0500
@@ -241,7 +241,9 @@
         difflines = self.ui.popbuffer().splitlines(1)
         if self.ui.configbool('notify', 'diffstat', True):
             s = patch.diffstat(difflines)
-            self.ui.write('\ndiffstat:\n\n' + s)
+            # 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 and len(difflines) > maxdiff:
             self.ui.write(_('\ndiffs (truncated from %d to %d lines):\n\n') %
                           (len(difflines), maxdiff))