Show More
@@ -1,284 +1,285 b'' | |||||
1 | # notify.py - email notifications for mercurial |
|
1 | # notify.py - email notifications for mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> |
|
3 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms |
|
5 | # This software may be used and distributed according to the terms | |
6 | # of the GNU General Public License, incorporated herein by reference. |
|
6 | # of the GNU General Public License, incorporated herein by reference. | |
7 | # |
|
7 | # | |
8 | # hook extension to email notifications to people when changesets are |
|
8 | # hook extension to email notifications to people when changesets are | |
9 | # committed to a repo they subscribe to. |
|
9 | # committed to a repo they subscribe to. | |
10 | # |
|
10 | # | |
11 | # default mode is to print messages to stdout, for testing and |
|
11 | # default mode is to print messages to stdout, for testing and | |
12 | # configuring. |
|
12 | # configuring. | |
13 | # |
|
13 | # | |
14 | # to use, configure notify extension and enable in hgrc like this: |
|
14 | # to use, configure notify extension and enable in hgrc like this: | |
15 | # |
|
15 | # | |
16 | # [extensions] |
|
16 | # [extensions] | |
17 | # hgext.notify = |
|
17 | # hgext.notify = | |
18 | # |
|
18 | # | |
19 | # [hooks] |
|
19 | # [hooks] | |
20 | # # one email for each incoming changeset |
|
20 | # # one email for each incoming changeset | |
21 | # incoming.notify = python:hgext.notify.hook |
|
21 | # incoming.notify = python:hgext.notify.hook | |
22 | # # batch emails when many changesets incoming at one time |
|
22 | # # batch emails when many changesets incoming at one time | |
23 | # changegroup.notify = python:hgext.notify.hook |
|
23 | # changegroup.notify = python:hgext.notify.hook | |
24 | # |
|
24 | # | |
25 | # [notify] |
|
25 | # [notify] | |
26 | # # config items go in here |
|
26 | # # config items go in here | |
27 | # |
|
27 | # | |
28 | # config items: |
|
28 | # config items: | |
29 | # |
|
29 | # | |
30 | # REQUIRED: |
|
30 | # REQUIRED: | |
31 | # config = /path/to/file # file containing subscriptions |
|
31 | # config = /path/to/file # file containing subscriptions | |
32 | # |
|
32 | # | |
33 | # OPTIONAL: |
|
33 | # OPTIONAL: | |
34 | # test = True # print messages to stdout for testing |
|
34 | # test = True # print messages to stdout for testing | |
35 | # strip = 3 # number of slashes to strip for url paths |
|
35 | # strip = 3 # number of slashes to strip for url paths | |
36 | # domain = example.com # domain to use if committer missing domain |
|
36 | # domain = example.com # domain to use if committer missing domain | |
37 | # style = ... # style file to use when formatting email |
|
37 | # style = ... # style file to use when formatting email | |
38 | # template = ... # template to use when formatting email |
|
38 | # template = ... # template to use when formatting email | |
39 | # incoming = ... # template to use when run as incoming hook |
|
39 | # incoming = ... # template to use when run as incoming hook | |
40 | # changegroup = ... # template when run as changegroup hook |
|
40 | # changegroup = ... # template when run as changegroup hook | |
41 | # maxdiff = 300 # max lines of diffs to include (0=none, -1=all) |
|
41 | # maxdiff = 300 # max lines of diffs to include (0=none, -1=all) | |
42 | # maxsubject = 67 # truncate subject line longer than this |
|
42 | # maxsubject = 67 # truncate subject line longer than this | |
43 | # diffstat = True # add a diffstat before the diff content |
|
43 | # diffstat = True # add a diffstat before the diff content | |
44 | # sources = serve # notify if source of incoming changes in this list |
|
44 | # sources = serve # notify if source of incoming changes in this list | |
45 | # # (serve == ssh or http, push, pull, bundle) |
|
45 | # # (serve == ssh or http, push, pull, bundle) | |
46 | # [email] |
|
46 | # [email] | |
47 | # from = user@host.com # email address to send as if none given |
|
47 | # from = user@host.com # email address to send as if none given | |
48 | # [web] |
|
48 | # [web] | |
49 | # baseurl = http://hgserver/... # root of hg web site for browsing commits |
|
49 | # baseurl = http://hgserver/... # root of hg web site for browsing commits | |
50 | # |
|
50 | # | |
51 | # notify config file has same format as regular hgrc. it has two |
|
51 | # notify config file has same format as regular hgrc. it has two | |
52 | # sections so you can express subscriptions in whatever way is handier |
|
52 | # sections so you can express subscriptions in whatever way is handier | |
53 | # for you. |
|
53 | # for you. | |
54 | # |
|
54 | # | |
55 | # [usersubs] |
|
55 | # [usersubs] | |
56 | # # key is subscriber email, value is ","-separated list of glob patterns |
|
56 | # # key is subscriber email, value is ","-separated list of glob patterns | |
57 | # user@host = pattern |
|
57 | # user@host = pattern | |
58 | # |
|
58 | # | |
59 | # [reposubs] |
|
59 | # [reposubs] | |
60 | # # key is glob pattern, value is ","-separated list of subscriber emails |
|
60 | # # key is glob pattern, value is ","-separated list of subscriber emails | |
61 | # pattern = user@host |
|
61 | # pattern = user@host | |
62 | # |
|
62 | # | |
63 | # glob patterns are matched against path to repo root. |
|
63 | # glob patterns are matched against path to repo root. | |
64 | # |
|
64 | # | |
65 | # if you like, you can put notify config file in repo that users can |
|
65 | # if you like, you can put notify config file in repo that users can | |
66 | # push changes to, they can manage their own subscriptions. |
|
66 | # push changes to, they can manage their own subscriptions. | |
67 |
|
67 | |||
68 | from mercurial.i18n import _ |
|
68 | from mercurial.i18n import _ | |
69 | from mercurial.node import * |
|
69 | from mercurial.node import * | |
70 | from mercurial import patch, cmdutil, templater, util, mail |
|
70 | from mercurial import patch, cmdutil, templater, util, mail | |
71 | import email.Parser, fnmatch, socket, time |
|
71 | import email.Parser, 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} | |
76 | From: {author} |
|
76 | From: {author} | |
77 |
|
77 | |||
78 | changeset {node|short} in {root} |
|
78 | changeset {node|short} in {root} | |
79 | details: {baseurl}{webroot}?cmd=changeset;node={node|short} |
|
79 | details: {baseurl}{webroot}?cmd=changeset;node={node|short} | |
80 | description: |
|
80 | description: | |
81 | \t{desc|tabindent|strip} |
|
81 | \t{desc|tabindent|strip} | |
82 | '''.lstrip() |
|
82 | '''.lstrip() | |
83 |
|
83 | |||
84 | # template for multiple changesets should not contain email headers, |
|
84 | # template for multiple changesets should not contain email headers, | |
85 | # because only first set of headers will be used and result will look |
|
85 | # because only first set of headers will be used and result will look | |
86 | # strange. |
|
86 | # strange. | |
87 | multiple_template = ''' |
|
87 | multiple_template = ''' | |
88 | changeset {node|short} in {root} |
|
88 | changeset {node|short} in {root} | |
89 | details: {baseurl}{webroot}?cmd=changeset;node={node|short} |
|
89 | details: {baseurl}{webroot}?cmd=changeset;node={node|short} | |
90 | summary: {desc|firstline} |
|
90 | summary: {desc|firstline} | |
91 | ''' |
|
91 | ''' | |
92 |
|
92 | |||
93 | deftemplates = { |
|
93 | deftemplates = { | |
94 | 'changegroup': multiple_template, |
|
94 | 'changegroup': multiple_template, | |
95 | } |
|
95 | } | |
96 |
|
96 | |||
97 | class notifier(object): |
|
97 | class notifier(object): | |
98 | '''email notification class.''' |
|
98 | '''email notification class.''' | |
99 |
|
99 | |||
100 | def __init__(self, ui, repo, hooktype): |
|
100 | def __init__(self, ui, repo, hooktype): | |
101 | self.ui = ui |
|
101 | self.ui = ui | |
102 | cfg = self.ui.config('notify', 'config') |
|
102 | cfg = self.ui.config('notify', 'config') | |
103 | if cfg: |
|
103 | if cfg: | |
104 | self.ui.readsections(cfg, 'usersubs', 'reposubs') |
|
104 | self.ui.readsections(cfg, 'usersubs', 'reposubs') | |
105 | self.repo = repo |
|
105 | self.repo = repo | |
106 | self.stripcount = int(self.ui.config('notify', 'strip', 0)) |
|
106 | self.stripcount = int(self.ui.config('notify', 'strip', 0)) | |
107 | self.root = self.strip(self.repo.root) |
|
107 | self.root = self.strip(self.repo.root) | |
108 | self.domain = self.ui.config('notify', 'domain') |
|
108 | self.domain = self.ui.config('notify', 'domain') | |
109 | self.subs = self.subscribers() |
|
109 | self.subs = self.subscribers() | |
110 |
|
110 | |||
111 | mapfile = self.ui.config('notify', 'style') |
|
111 | mapfile = self.ui.config('notify', 'style') | |
112 | template = (self.ui.config('notify', hooktype) or |
|
112 | template = (self.ui.config('notify', hooktype) or | |
113 | self.ui.config('notify', 'template')) |
|
113 | self.ui.config('notify', 'template')) | |
114 | self.t = cmdutil.changeset_templater(self.ui, self.repo, |
|
114 | self.t = cmdutil.changeset_templater(self.ui, self.repo, | |
115 | False, mapfile, False) |
|
115 | False, mapfile, False) | |
116 | if not mapfile and not template: |
|
116 | if not mapfile and not template: | |
117 | template = deftemplates.get(hooktype) or single_template |
|
117 | template = deftemplates.get(hooktype) or single_template | |
118 | if template: |
|
118 | if template: | |
119 | template = templater.parsestring(template, quoted=False) |
|
119 | template = templater.parsestring(template, quoted=False) | |
120 | self.t.use_template(template) |
|
120 | self.t.use_template(template) | |
121 |
|
121 | |||
122 | def strip(self, path): |
|
122 | def strip(self, path): | |
123 | '''strip leading slashes from local path, turn into web-safe path.''' |
|
123 | '''strip leading slashes from local path, turn into web-safe path.''' | |
124 |
|
124 | |||
125 | path = util.pconvert(path) |
|
125 | path = util.pconvert(path) | |
126 | count = self.stripcount |
|
126 | count = self.stripcount | |
127 | while count > 0: |
|
127 | while count > 0: | |
128 | c = path.find('/') |
|
128 | c = path.find('/') | |
129 | if c == -1: |
|
129 | if c == -1: | |
130 | break |
|
130 | break | |
131 | path = path[c+1:] |
|
131 | path = path[c+1:] | |
132 | count -= 1 |
|
132 | count -= 1 | |
133 | return path |
|
133 | return path | |
134 |
|
134 | |||
135 | def fixmail(self, addr): |
|
135 | def fixmail(self, addr): | |
136 | '''try to clean up email addresses.''' |
|
136 | '''try to clean up email addresses.''' | |
137 |
|
137 | |||
138 | addr = templater.email(addr.strip()) |
|
138 | addr = templater.email(addr.strip()) | |
139 | if self.domain: |
|
139 | if self.domain: | |
140 | a = addr.find('@localhost') |
|
140 | a = addr.find('@localhost') | |
141 | if a != -1: |
|
141 | if a != -1: | |
142 | addr = addr[:a] |
|
142 | addr = addr[:a] | |
143 | if '@' not in addr: |
|
143 | if '@' not in addr: | |
144 | return addr + '@' + self.domain |
|
144 | return addr + '@' + self.domain | |
145 | return addr |
|
145 | return addr | |
146 |
|
146 | |||
147 | def subscribers(self): |
|
147 | def subscribers(self): | |
148 | '''return list of email addresses of subscribers to this repo.''' |
|
148 | '''return list of email addresses of subscribers to this repo.''' | |
149 |
|
149 | |||
150 | subs = {} |
|
150 | subs = {} | |
151 | for user, pats in self.ui.configitems('usersubs'): |
|
151 | for user, pats in self.ui.configitems('usersubs'): | |
152 | for pat in pats.split(','): |
|
152 | for pat in pats.split(','): | |
153 | if fnmatch.fnmatch(self.repo.root, pat.strip()): |
|
153 | if fnmatch.fnmatch(self.repo.root, pat.strip()): | |
154 | subs[self.fixmail(user)] = 1 |
|
154 | subs[self.fixmail(user)] = 1 | |
155 | for pat, users in self.ui.configitems('reposubs'): |
|
155 | for pat, users in self.ui.configitems('reposubs'): | |
156 | if fnmatch.fnmatch(self.repo.root, pat): |
|
156 | if fnmatch.fnmatch(self.repo.root, pat): | |
157 | for user in users.split(','): |
|
157 | for user in users.split(','): | |
158 | subs[self.fixmail(user)] = 1 |
|
158 | subs[self.fixmail(user)] = 1 | |
159 | subs = subs.keys() |
|
159 | subs = subs.keys() | |
160 | subs.sort() |
|
160 | subs.sort() | |
161 | return subs |
|
161 | return subs | |
162 |
|
162 | |||
163 | def url(self, path=None): |
|
163 | def url(self, path=None): | |
164 | return self.ui.config('web', 'baseurl') + (path or self.root) |
|
164 | return self.ui.config('web', 'baseurl') + (path or self.root) | |
165 |
|
165 | |||
166 | def node(self, node): |
|
166 | def node(self, node): | |
167 | '''format one changeset.''' |
|
167 | '''format one changeset.''' | |
168 |
|
168 | |||
169 | self.t.show(changenode=node, changes=self.repo.changelog.read(node), |
|
169 | self.t.show(changenode=node, changes=self.repo.changelog.read(node), | |
170 | baseurl=self.ui.config('web', 'baseurl'), |
|
170 | baseurl=self.ui.config('web', 'baseurl'), | |
171 | root=self.repo.root, |
|
171 | root=self.repo.root, | |
172 | webroot=self.root) |
|
172 | webroot=self.root) | |
173 |
|
173 | |||
174 | def skipsource(self, source): |
|
174 | def skipsource(self, source): | |
175 | '''true if incoming changes from this source should be skipped.''' |
|
175 | '''true if incoming changes from this source should be skipped.''' | |
176 | ok_sources = self.ui.config('notify', 'sources', 'serve').split() |
|
176 | ok_sources = self.ui.config('notify', 'sources', 'serve').split() | |
177 | return source not in ok_sources |
|
177 | return source not in ok_sources | |
178 |
|
178 | |||
179 | def send(self, node, count, data): |
|
179 | def send(self, node, count, data): | |
180 | '''send message.''' |
|
180 | '''send message.''' | |
181 |
|
181 | |||
182 | p = email.Parser.Parser() |
|
182 | p = email.Parser.Parser() | |
183 | msg = p.parsestr(data) |
|
183 | msg = p.parsestr(data) | |
184 |
|
184 | |||
185 | def fix_subject(): |
|
185 | def fix_subject(): | |
186 | '''try to make subject line exist and be useful.''' |
|
186 | '''try to make subject line exist and be useful.''' | |
187 |
|
187 | |||
188 | subject = msg['Subject'] |
|
188 | subject = msg['Subject'] | |
189 | if not subject: |
|
189 | if not subject: | |
190 | if count > 1: |
|
190 | if count > 1: | |
191 | subject = _('%s: %d new changesets') % (self.root, count) |
|
191 | subject = _('%s: %d new changesets') % (self.root, count) | |
192 | else: |
|
192 | else: | |
193 | changes = self.repo.changelog.read(node) |
|
193 | changes = self.repo.changelog.read(node) | |
194 | s = changes[4].lstrip().split('\n', 1)[0].rstrip() |
|
194 | s = changes[4].lstrip().split('\n', 1)[0].rstrip() | |
195 | subject = '%s: %s' % (self.root, s) |
|
195 | subject = '%s: %s' % (self.root, s) | |
196 | maxsubject = int(self.ui.config('notify', 'maxsubject', 67)) |
|
196 | maxsubject = int(self.ui.config('notify', 'maxsubject', 67)) | |
197 | if maxsubject and len(subject) > maxsubject: |
|
197 | if maxsubject and len(subject) > maxsubject: | |
198 | subject = subject[:maxsubject-3] + '...' |
|
198 | subject = subject[:maxsubject-3] + '...' | |
199 | del msg['Subject'] |
|
199 | del msg['Subject'] | |
200 | msg['Subject'] = subject |
|
200 | msg['Subject'] = subject | |
201 |
|
201 | |||
202 | def fix_sender(): |
|
202 | def fix_sender(): | |
203 | '''try to make message have proper sender.''' |
|
203 | '''try to make message have proper sender.''' | |
204 |
|
204 | |||
205 | sender = msg['From'] |
|
205 | sender = msg['From'] | |
206 | if not sender: |
|
206 | if not sender: | |
207 | sender = self.ui.config('email', 'from') or self.ui.username() |
|
207 | sender = self.ui.config('email', 'from') or self.ui.username() | |
208 | if '@' not in sender or '@localhost' in sender: |
|
208 | if '@' not in sender or '@localhost' in sender: | |
209 | sender = self.fixmail(sender) |
|
209 | sender = self.fixmail(sender) | |
210 | del msg['From'] |
|
210 | del msg['From'] | |
211 | msg['From'] = sender |
|
211 | msg['From'] = sender | |
212 |
|
212 | |||
213 | msg['Date'] = util.datestr(date=util.makedate(), |
|
213 | msg['Date'] = util.datestr(date=util.makedate(), | |
214 |
format="%a, %d %b %Y %H:%M:%S", |
|
214 | format="%a, %d %b %Y %H:%M:%S", | |
|
215 | timezone=True) | |||
215 | fix_subject() |
|
216 | fix_subject() | |
216 | fix_sender() |
|
217 | fix_sender() | |
217 |
|
218 | |||
218 | msg['X-Hg-Notification'] = 'changeset ' + short(node) |
|
219 | msg['X-Hg-Notification'] = 'changeset ' + short(node) | |
219 | if not msg['Message-Id']: |
|
220 | if not msg['Message-Id']: | |
220 | msg['Message-Id'] = ('<hg.%s.%s.%s@%s>' % |
|
221 | msg['Message-Id'] = ('<hg.%s.%s.%s@%s>' % | |
221 | (short(node), int(time.time()), |
|
222 | (short(node), int(time.time()), | |
222 | hash(self.repo.root), socket.getfqdn())) |
|
223 | hash(self.repo.root), socket.getfqdn())) | |
223 | msg['To'] = ', '.join(self.subs) |
|
224 | msg['To'] = ', '.join(self.subs) | |
224 |
|
225 | |||
225 | msgtext = msg.as_string(0) |
|
226 | msgtext = msg.as_string(0) | |
226 | if self.ui.configbool('notify', 'test', True): |
|
227 | if self.ui.configbool('notify', 'test', True): | |
227 | self.ui.write(msgtext) |
|
228 | self.ui.write(msgtext) | |
228 | if not msgtext.endswith('\n'): |
|
229 | if not msgtext.endswith('\n'): | |
229 | self.ui.write('\n') |
|
230 | self.ui.write('\n') | |
230 | else: |
|
231 | else: | |
231 | self.ui.status(_('notify: sending %d subscribers %d changes\n') % |
|
232 | self.ui.status(_('notify: sending %d subscribers %d changes\n') % | |
232 |
|
|
233 | (len(self.subs), count)) | |
233 | mail.sendmail(self.ui, templater.email(msg['From']), |
|
234 | mail.sendmail(self.ui, templater.email(msg['From']), | |
234 | self.subs, msgtext) |
|
235 | self.subs, msgtext) | |
235 |
|
236 | |||
236 | def diff(self, node, ref): |
|
237 | def diff(self, node, ref): | |
237 | maxdiff = int(self.ui.config('notify', 'maxdiff', 300)) |
|
238 | maxdiff = int(self.ui.config('notify', 'maxdiff', 300)) | |
238 | if maxdiff == 0: |
|
239 | if maxdiff == 0: | |
239 | return |
|
240 | return | |
240 | prev = self.repo.changelog.parents(node)[0] |
|
241 | prev = self.repo.changelog.parents(node)[0] | |
241 | self.ui.pushbuffer() |
|
242 | self.ui.pushbuffer() | |
242 | patch.diff(self.repo, prev, ref) |
|
243 | patch.diff(self.repo, prev, ref) | |
243 | difflines = self.ui.popbuffer().splitlines(1) |
|
244 | difflines = self.ui.popbuffer().splitlines(1) | |
244 | if self.ui.configbool('notify', 'diffstat', True): |
|
245 | if self.ui.configbool('notify', 'diffstat', True): | |
245 | s = patch.diffstat(difflines) |
|
246 | s = patch.diffstat(difflines) | |
246 | # s may be nil, don't include the header if it is |
|
247 | # s may be nil, don't include the header if it is | |
247 | if s: |
|
248 | if s: | |
248 | self.ui.write('\ndiffstat:\n\n%s' % s) |
|
249 | self.ui.write('\ndiffstat:\n\n%s' % s) | |
249 | if maxdiff > 0 and len(difflines) > maxdiff: |
|
250 | if maxdiff > 0 and len(difflines) > maxdiff: | |
250 | self.ui.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % |
|
251 | self.ui.write(_('\ndiffs (truncated from %d to %d lines):\n\n') % | |
251 | (len(difflines), maxdiff)) |
|
252 | (len(difflines), maxdiff)) | |
252 | difflines = difflines[:maxdiff] |
|
253 | difflines = difflines[:maxdiff] | |
253 | elif difflines: |
|
254 | elif difflines: | |
254 | self.ui.write(_('\ndiffs (%d lines):\n\n') % len(difflines)) |
|
255 | self.ui.write(_('\ndiffs (%d lines):\n\n') % len(difflines)) | |
255 | self.ui.write(*difflines) |
|
256 | self.ui.write(*difflines) | |
256 |
|
257 | |||
257 | def hook(ui, repo, hooktype, node=None, source=None, **kwargs): |
|
258 | def hook(ui, repo, hooktype, node=None, source=None, **kwargs): | |
258 | '''send email notifications to interested subscribers. |
|
259 | '''send email notifications to interested subscribers. | |
259 |
|
260 | |||
260 | if used as changegroup hook, send one email for all changesets in |
|
261 | if used as changegroup hook, send one email for all changesets in | |
261 | changegroup. else send one email per changeset.''' |
|
262 | changegroup. else send one email per changeset.''' | |
262 | n = notifier(ui, repo, hooktype) |
|
263 | n = notifier(ui, repo, hooktype) | |
263 | if not n.subs: |
|
264 | if not n.subs: | |
264 | ui.debug(_('notify: no subscribers to repo %s\n') % n.root) |
|
265 | ui.debug(_('notify: no subscribers to repo %s\n') % n.root) | |
265 | return |
|
266 | return | |
266 | if n.skipsource(source): |
|
267 | if n.skipsource(source): | |
267 | ui.debug(_('notify: changes have source "%s" - skipping\n') % |
|
268 | ui.debug(_('notify: changes have source "%s" - skipping\n') % | |
268 |
|
|
269 | source) | |
269 | return |
|
270 | return | |
270 | node = bin(node) |
|
271 | node = bin(node) | |
271 | ui.pushbuffer() |
|
272 | ui.pushbuffer() | |
272 | if hooktype == 'changegroup': |
|
273 | if hooktype == 'changegroup': | |
273 | start = repo.changelog.rev(node) |
|
274 | start = repo.changelog.rev(node) | |
274 | end = repo.changelog.count() |
|
275 | end = repo.changelog.count() | |
275 | count = end - start |
|
276 | count = end - start | |
276 | for rev in xrange(start, end): |
|
277 | for rev in xrange(start, end): | |
277 | n.node(repo.changelog.node(rev)) |
|
278 | n.node(repo.changelog.node(rev)) | |
278 | n.diff(node, repo.changelog.tip()) |
|
279 | n.diff(node, repo.changelog.tip()) | |
279 | else: |
|
280 | else: | |
280 | count = 1 |
|
281 | count = 1 | |
281 | n.node(node) |
|
282 | n.node(node) | |
282 | n.diff(node, node) |
|
283 | n.diff(node, node) | |
283 | data = ui.popbuffer() |
|
284 | data = ui.popbuffer() | |
284 | n.send(node, count, data) |
|
285 | n.send(node, count, data) |
@@ -1,57 +1,57 b'' | |||||
1 | default = 'summary' |
|
1 | default = 'summary' | |
2 | header = header.tmpl |
|
2 | header = header.tmpl | |
3 | footer = footer.tmpl |
|
3 | footer = footer.tmpl | |
4 | search = search.tmpl |
|
4 | search = search.tmpl | |
5 | changelog = changelog.tmpl |
|
5 | changelog = changelog.tmpl | |
6 | summary = summary.tmpl |
|
6 | summary = summary.tmpl | |
7 | error = error.tmpl |
|
7 | error = error.tmpl | |
8 | naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' |
|
8 | naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' | |
9 | navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' |
|
9 | navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> ' | |
10 | filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> ' |
|
10 | filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> ' | |
11 | filedifflink = '<a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> ' |
|
11 | filedifflink = '<a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#file|escape#</a> ' | |
12 | filenodelink = '<tr class="parity#parity#"><td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">#file|escape#</a></td><td></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> | <a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a></td></tr>' |
|
12 | filenodelink = '<tr class="parity#parity#"><td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">#file|escape#</a></td><td></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> | <a href="#url#diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a></td></tr>' | |
13 | fileellipses = '...' |
|
13 | fileellipses = '...' | |
14 | changelogentry = changelogentry.tmpl |
|
14 | changelogentry = changelogentry.tmpl | |
15 | searchentry = changelogentry.tmpl |
|
15 | searchentry = changelogentry.tmpl | |
16 | changeset = changeset.tmpl |
|
16 | changeset = changeset.tmpl | |
17 | manifest = manifest.tmpl |
|
17 | manifest = manifest.tmpl | |
18 | manifestdirentry = '<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td style="font-family:monospace"></td><td><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">manifest</a></td></tr>' |
|
18 | manifestdirentry = '<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td style="font-family:monospace"></td><td><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">manifest</a></td></tr>' | |
19 | manifestfileentry = '<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td style="font-family:monospace" align=right>#size#</td><td class="list"><a class="list" href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a></td></tr>' |
|
19 | manifestfileentry = '<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td style="font-family:monospace" align=right>#size#</td><td class="list"><a class="list" href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a></td></tr>' | |
20 | filerevision = filerevision.tmpl |
|
20 | filerevision = filerevision.tmpl | |
21 | fileannotate = fileannotate.tmpl |
|
21 | fileannotate = fileannotate.tmpl | |
22 | filediff = filediff.tmpl |
|
22 | filediff = filediff.tmpl | |
23 | filelog = filelog.tmpl |
|
23 | filelog = filelog.tmpl | |
24 | fileline = '<div style="font-family:monospace" class="parity#parity#"><pre><span class="linenr"> #linenumber#</span> #line|escape#</pre></div>' |
|
24 | fileline = '<div style="font-family:monospace" class="parity#parity#"><pre><span class="linenr"> #linenumber#</span> #line|escape#</pre></div>' | |
25 | annotateline = '<tr style="font-family:monospace" class="parity#parity#"><td class="linenr" style="text-align: right;"><a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#author|obfuscate#@#rev#</a></td><td><pre>#line|escape#</pre></td></tr>' |
|
25 | annotateline = '<tr style="font-family:monospace" class="parity#parity#"><td class="linenr" style="text-align: right;"><a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#author|obfuscate#@#rev#</a></td><td><pre>#line|escape#</pre></td></tr>' | |
26 | difflineplus = '<div style="color:#008800;">#line|escape#</div>' |
|
26 | difflineplus = '<div style="color:#008800;">#line|escape#</div>' | |
27 | difflineminus = '<div style="color:#cc0000;">#line|escape#</div>' |
|
27 | difflineminus = '<div style="color:#cc0000;">#line|escape#</div>' | |
28 | difflineat = '<div style="color:#990099;">#line|escape#</div>' |
|
28 | difflineat = '<div style="color:#990099;">#line|escape#</div>' | |
29 | diffline = '<div>#line|escape#</div>' |
|
29 | diffline = '<div>#line|escape#</div>' | |
30 | changelogparent = '<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>' |
|
30 | changelogparent = '<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>' | |
31 | changesetparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>' |
|
31 | changesetparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>' | |
32 | filerevparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>' |
|
32 | filerevparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>' | |
33 | filerename = '{file|escape}@' |
|
33 | filerename = '{file|escape}@' | |
34 | filelogrename = '| <a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">base</a>' |
|
34 | filelogrename = '| <a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">base</a>' | |
35 | fileannotateparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>' |
|
35 | fileannotateparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>' | |
36 | changelogchild = '<tr><th class="child">child #rev#:</th><td class="child"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>' |
|
36 | changelogchild = '<tr><th class="child">child #rev#:</th><td class="child"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>' | |
37 | changesetchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>' |
|
37 | changesetchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>' | |
38 | filerevchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' |
|
38 | filerevchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' | |
39 | fileannotatechild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' |
|
39 | fileannotatechild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' | |
40 | tags = tags.tmpl |
|
40 | tags = tags.tmpl | |
41 | tagentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>#tag|escape#</b></a></td><td class="link"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/#node|short#{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>' |
|
41 | tagentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>#tag|escape#</b></a></td><td class="link"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/#node|short#{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>' | |
42 | branchentry = '<tr class="parity{parity}"><td class="age"><i>{date|age} ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></td><td>{branch|escape}</td><td class="link"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/{node|short}{sessionvars%urlparameter}">manifest</a></td></tr>' |
|
42 | branchentry = '<tr class="parity{parity}"><td class="age"><i>{date|age} ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></td><td>{branch|escape}</td><td class="link"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/{node|short}{sessionvars%urlparameter}">manifest</a></td></tr>' | |
43 | diffblock = '<pre>#lines#</pre>' |
|
43 | diffblock = '<pre>#lines#</pre>' | |
44 | changelogtag = '<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>' |
|
44 | changelogtag = '<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>' | |
45 | changesettag = '<tr><td>tag</td><td>#tag|escape#</td></tr>' |
|
45 | changesettag = '<tr><td>tag</td><td>#tag|escape#</td></tr>' | |
46 | filediffparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' |
|
46 | filediffparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' | |
47 | filelogparent = '<tr><td align="right">parent #rev#: </td><td><a href="{url}file/{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>' |
|
47 | filelogparent = '<tr><td align="right">parent #rev#: </td><td><a href="{url}file/{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>' | |
48 | filediffchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' |
|
48 | filediffchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>' | |
49 | filelogchild = '<tr><td align="right">child #rev#: </td><td><a href="{url}file{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>' |
|
49 | filelogchild = '<tr><td align="right">child #rev#: </td><td><a href="{url}file{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>' | |
50 | shortlog = shortlog.tmpl |
|
50 | shortlog = shortlog.tmpl | |
51 | shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>' |
|
51 | shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author|obfuscate#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>' | |
52 | filelogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a> | <a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>' |
|
52 | filelogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a> | <a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>' | |
53 | archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> ' |
|
53 | archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> ' | |
54 | indexentry = '<tr class="parity#parity#"><td><a class="list" href="#url#{sessionvars%urlparameter}"><b>#name|escape#</b></a></td><td>#description#</td><td>#contact|obfuscate#</td><td class="age">#lastchange|age# ago</td><td class="indexlinks"><a class="rss_logo" href="#url#rss-log">RSS</a> #archives%archiveentry#</td></tr>' |
|
54 | indexentry = '<tr class="parity#parity#"><td><a class="list" href="#url#{sessionvars%urlparameter}"><b>#name|escape#</b></a></td><td>#description#</td><td>#contact|obfuscate#</td><td class="age">#lastchange|age# ago</td><td class="indexlinks"><a class="rss_logo" href="#url#rss-log">RSS</a> #archives%archiveentry#</td></tr>' | |
55 | index = index.tmpl |
|
55 | index = index.tmpl | |
56 | urlparameter = '#separator##name#=#value|urlescape#' |
|
56 | urlparameter = '#separator##name#=#value|urlescape#' | |
57 | hiddenformentry = '<input type="hidden" name="#name#" value="#value|escape#" />' |
|
57 | hiddenformentry = '<input type="hidden" name="#name#" value="#value|escape#" />' |
General Comments 0
You need to be logged in to leave comments.
Login now