##// END OF EJS Templates
notify: fix diffstat printing...
divy@chelsio.com -
r6979:a3fd4aa1 default
parent child Browse files
Show More
@@ -233,9 +233,11 b' class notifier(object):'
233 def diff(self, node, ref):
233 def diff(self, node, ref):
234 maxdiff = int(self.ui.config('notify', 'maxdiff', 300))
234 maxdiff = int(self.ui.config('notify', 'maxdiff', 300))
235 prev = self.repo.changelog.parents(node)[0]
235 prev = self.repo.changelog.parents(node)[0]
236
236 self.ui.pushbuffer()
237 self.ui.pushbuffer()
237 patch.diff(self.repo, prev, ref, opts=patch.diffopts(self.ui))
238 patch.diff(self.repo, prev, ref, opts=patch.diffopts(self.ui))
238 difflines = self.ui.popbuffer().splitlines(1)
239 difflines = self.ui.popbuffer().splitlines()
240
239 if self.ui.configbool('notify', 'diffstat', True):
241 if self.ui.configbool('notify', 'diffstat', True):
240 s = patch.diffstat(difflines)
242 s = patch.diffstat(difflines)
241 # s may be nil, don't include the header if it is
243 # s may be nil, don't include the header if it is
@@ -249,7 +251,7 b' class notifier(object):'
249 difflines = difflines[:maxdiff]
251 difflines = difflines[:maxdiff]
250 elif difflines:
252 elif difflines:
251 self.ui.write(_('\ndiffs (%d lines):\n\n') % len(difflines))
253 self.ui.write(_('\ndiffs (%d lines):\n\n') % len(difflines))
252 self.ui.write(*difflines)
254 self.ui.write("\n".join(difflines))
253
255
254 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
256 def hook(ui, repo, hooktype, node=None, source=None, **kwargs):
255 '''send email notifications to interested subscribers.
257 '''send email notifications to interested subscribers.
General Comments 0
You need to be logged in to leave comments. Login now