Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/notify.py @ 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 | 16f8e7d1dd54 |
children | e6d26e71f049 fbf0e9acfd83 |
comparison
equal
deleted
inserted
replaced
4076:5a89c61c189c | 4077:1305ba7dee88 |
---|---|
239 self.ui.pushbuffer() | 239 self.ui.pushbuffer() |
240 patch.diff(self.repo, prev, ref) | 240 patch.diff(self.repo, prev, ref) |
241 difflines = self.ui.popbuffer().splitlines(1) | 241 difflines = self.ui.popbuffer().splitlines(1) |
242 if self.ui.configbool('notify', 'diffstat', True): | 242 if self.ui.configbool('notify', 'diffstat', True): |
243 s = patch.diffstat(difflines) | 243 s = patch.diffstat(difflines) |
244 self.ui.write('\ndiffstat:\n\n' + s) | 244 # s may be nil, don't include the header if it is |
245 if s: | |
246 self.ui.write('\ndiffstat:\n\n%s' % s) | |
245 if maxdiff > 0 and len(difflines) > maxdiff: | 247 if maxdiff > 0 and len(difflines) > maxdiff: |
246 self.ui.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % | 248 self.ui.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % |
247 (len(difflines), maxdiff)) | 249 (len(difflines), maxdiff)) |
248 difflines = difflines[:maxdiff] | 250 difflines = difflines[:maxdiff] |
249 elif difflines: | 251 elif difflines: |