Mercurial > hg
comparison hgext/notify.py @ 3096:f422c8265ae5
Add support for diffstat in commit emails, and move diffstat from
patchbomb to patch
author | Matt Doar <matt@xensource.com> |
---|---|
date | Wed, 13 Sep 2006 13:14:08 -0700 |
parents | 47aad3489da8 |
children | f0415b61949d |
comparison
equal
deleted
inserted
replaced
3095:25857e00af8e | 3096:f422c8265ae5 |
---|---|
238 return | 238 return |
239 fp = templater.stringio() | 239 fp = templater.stringio() |
240 prev = self.repo.changelog.parents(node)[0] | 240 prev = self.repo.changelog.parents(node)[0] |
241 patch.diff(self.repo, prev, ref, fp=fp) | 241 patch.diff(self.repo, prev, ref, fp=fp) |
242 difflines = fp.getvalue().splitlines(1) | 242 difflines = fp.getvalue().splitlines(1) |
243 if self.ui.configbool('notify', 'diffstat', True): | |
244 s = patch.diffstat(difflines) | |
245 self.sio.write('\ndiffstat:\n\n' + s) | |
243 if maxdiff > 0 and len(difflines) > maxdiff: | 246 if maxdiff > 0 and len(difflines) > maxdiff: |
244 self.sio.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % | 247 self.sio.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % |
245 (len(difflines), maxdiff)) | 248 (len(difflines), maxdiff)) |
246 difflines = difflines[:maxdiff] | 249 difflines = difflines[:maxdiff] |
247 elif difflines: | 250 elif difflines: |