equal
deleted
inserted
replaced
65 # push changes to, they can manage their own subscriptions. |
65 # push changes to, they can manage their own subscriptions. |
66 |
66 |
67 from mercurial.demandload import * |
67 from mercurial.demandload import * |
68 from mercurial.i18n import gettext as _ |
68 from mercurial.i18n import gettext as _ |
69 from mercurial.node import * |
69 from mercurial.node import * |
70 demandload(globals(), 'email.Parser mercurial:commands,templater,util') |
70 demandload(globals(), 'email.Parser mercurial:commands,patch,templater,util') |
71 demandload(globals(), 'fnmatch socket time') |
71 demandload(globals(), 'fnmatch socket time') |
72 |
72 |
73 # template for single changeset can include email headers. |
73 # template for single changeset can include email headers. |
74 single_template = ''' |
74 single_template = ''' |
75 Subject: changeset in {webroot}: {desc|firstline|strip} |
75 Subject: changeset in {webroot}: {desc|firstline|strip} |
236 maxdiff = int(self.ui.config('notify', 'maxdiff', 300)) |
236 maxdiff = int(self.ui.config('notify', 'maxdiff', 300)) |
237 if maxdiff == 0: |
237 if maxdiff == 0: |
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 commands.dodiff(fp, self.ui, self.repo, prev, ref) |
241 patch.diff(self.repo, fp, prev, ref) |
242 difflines = fp.getvalue().splitlines(1) |
242 difflines = fp.getvalue().splitlines(1) |
243 if maxdiff > 0 and len(difflines) > maxdiff: |
243 if maxdiff > 0 and len(difflines) > maxdiff: |
244 self.sio.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % |
244 self.sio.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % |
245 (len(difflines), maxdiff)) |
245 (len(difflines), maxdiff)) |
246 difflines = difflines[:maxdiff] |
246 difflines = difflines[:maxdiff] |