##// END OF EJS Templates
notify changeset diff should be against current node instead of tip
"Aurelien Jacobs " -
r2296:6e8e3dd7 default
parent child Browse files
Show More
@@ -228,14 +228,13 b' class notifier(object):'
228 mail = self.ui.sendmail()
228 mail = self.ui.sendmail()
229 mail.sendmail(templater.email(msg['From']), self.subs, msgtext)
229 mail.sendmail(templater.email(msg['From']), self.subs, msgtext)
230
230
231 def diff(self, node):
231 def diff(self, node, ref):
232 maxdiff = int(self.ui.config('notify', 'maxdiff', 300))
232 maxdiff = int(self.ui.config('notify', 'maxdiff', 300))
233 if maxdiff == 0:
233 if maxdiff == 0:
234 return
234 return
235 fp = templater.stringio()
235 fp = templater.stringio()
236 prev = self.repo.changelog.parents(node)[0]
236 prev = self.repo.changelog.parents(node)[0]
237 commands.dodiff(fp, self.ui, self.repo, prev,
237 commands.dodiff(fp, self.ui, self.repo, prev, ref)
238 self.repo.changelog.tip())
239 difflines = fp.getvalue().splitlines(1)
238 difflines = fp.getvalue().splitlines(1)
240 if maxdiff > 0 and len(difflines) > maxdiff:
239 if maxdiff > 0 and len(difflines) > maxdiff:
241 self.sio.write(_('\ndiffs (truncated from %d to %d lines):\n\n') %
240 self.sio.write(_('\ndiffs (truncated from %d to %d lines):\n\n') %
@@ -260,8 +259,9 b' def hook(ui, repo, hooktype, node=None, '
260 count = end - start
259 count = end - start
261 for rev in xrange(start, end):
260 for rev in xrange(start, end):
262 n.node(repo.changelog.node(rev))
261 n.node(repo.changelog.node(rev))
262 n.diff(node, repo.changelog.tip())
263 else:
263 else:
264 count = 1
264 count = 1
265 n.node(node)
265 n.node(node)
266 n.diff(node)
266 n.diff(node, node)
267 n.send(node, count)
267 n.send(node, count)
General Comments 0
You need to be logged in to leave comments. Login now