# HG changeset patch # User Sean Dague # Date 1170171325 18000 # Node ID 1305ba7dee88a7879d010ab6257cc7af9ecf1032 # Parent 5a89c61c189c91338c19a731f81f62357fc78987 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 diff --git a/hgext/notify.py b/hgext/notify.py --- a/hgext/notify.py +++ b/hgext/notify.py @@ -241,7 +241,9 @@ class notifier(object): 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))