Show More
@@ -70,7 +70,7 b' def template(tmpl, filters = {}, **map):' | |||||
70 | if m: |
|
70 | if m: | |
71 | yield tmpl[:m.start(0)] |
|
71 | yield tmpl[:m.start(0)] | |
72 | v = map.get(m.group(1), "") |
|
72 | v = map.get(m.group(1), "") | |
73 | v = callable(v) and v() or v |
|
73 | v = callable(v) and v(**map) or v | |
74 |
|
74 | |||
75 | fl = m.group(2) |
|
75 | fl = m.group(2) | |
76 | if fl: |
|
76 | if fl: | |
@@ -224,14 +224,8 b' class hgweb:' | |||||
224 | tn = None |
|
224 | tn = None | |
225 | yield diffblock(mdiff.unidiff(to, date1, tn, date2, f), f, tn) |
|
225 | yield diffblock(mdiff.unidiff(to, date1, tn, date2, f), f, tn) | |
226 |
|
226 | |||
227 | def header(self): |
|
|||
228 | yield self.t("header") |
|
|||
229 |
|
||||
230 | def footer(self): |
|
|||
231 | yield self.t("footer") |
|
|||
232 |
|
||||
233 | def changelog(self, pos): |
|
227 | def changelog(self, pos): | |
234 | def changenav(): |
|
228 | def changenav(**map): | |
235 | def seq(factor = 1): |
|
229 | def seq(factor = 1): | |
236 | yield 1 * factor |
|
230 | yield 1 * factor | |
237 | yield 3 * factor |
|
231 | yield 3 * factor | |
@@ -254,7 +248,7 b' class hgweb:' | |||||
254 |
|
248 | |||
255 | yield self.t("naventry", label="tip") |
|
249 | yield self.t("naventry", label="tip") | |
256 |
|
250 | |||
257 | def changelist(): |
|
251 | def changelist(**map): | |
258 | parity = (start - end) & 1 |
|
252 | parity = (start - end) & 1 | |
259 | cl = self.repo.changelog |
|
253 | cl = self.repo.changelog | |
260 | l = [] # build a list in forward order for efficiency |
|
254 | l = [] # build a list in forward order for efficiency | |
@@ -295,7 +289,7 b' class hgweb:' | |||||
295 |
|
289 | |||
296 | def search(self, query): |
|
290 | def search(self, query): | |
297 |
|
291 | |||
298 | def changelist(): |
|
292 | def changelist(**map): | |
299 | cl = self.repo.changelog |
|
293 | cl = self.repo.changelog | |
300 | count = 0 |
|
294 | count = 0 | |
301 | qw = query.lower().split() |
|
295 | qw = query.lower().split() | |
@@ -361,7 +355,7 b' class hgweb:' | |||||
361 | files.append(self.t("filenodelink", |
|
355 | files.append(self.t("filenodelink", | |
362 | filenode = hex(mf.get(f, nullid)), file = f)) |
|
356 | filenode = hex(mf.get(f, nullid)), file = f)) | |
363 |
|
357 | |||
364 | def diff(): |
|
358 | def diff(**map): | |
365 | yield self.diff(p1, n, None) |
|
359 | yield self.diff(p1, n, None) | |
366 |
|
360 | |||
367 | yield self.t('changeset', |
|
361 | yield self.t('changeset', | |
@@ -382,7 +376,7 b' class hgweb:' | |||||
382 | fl = self.repo.file(f) |
|
376 | fl = self.repo.file(f) | |
383 | count = fl.count() |
|
377 | count = fl.count() | |
384 |
|
378 | |||
385 | def entries(): |
|
379 | def entries(**map): | |
386 | l = [] |
|
380 | l = [] | |
387 | parity = (count - 1) & 1 |
|
381 | parity = (count - 1) & 1 | |
388 |
|
382 | |||
@@ -457,7 +451,7 b' class hgweb:' | |||||
457 | t = float(cs[2].split(' ')[0]) |
|
451 | t = float(cs[2].split(' ')[0]) | |
458 | mfn = cs[0] |
|
452 | mfn = cs[0] | |
459 |
|
453 | |||
460 | def annotate(): |
|
454 | def annotate(**map): | |
461 | parity = 1 |
|
455 | parity = 1 | |
462 | last = None |
|
456 | last = None | |
463 | for r, l in fl.annotate(n): |
|
457 | for r, l in fl.annotate(n): | |
@@ -527,7 +521,7 b' class hgweb:' | |||||
527 | short = os.path.basename(remain) |
|
521 | short = os.path.basename(remain) | |
528 | files[short] = (f, n) |
|
522 | files[short] = (f, n) | |
529 |
|
523 | |||
530 | def filelist(): |
|
524 | def filelist(**map): | |
531 | parity = 0 |
|
525 | parity = 0 | |
532 | fl = files.keys() |
|
526 | fl = files.keys() | |
533 | fl.sort() |
|
527 | fl.sort() | |
@@ -563,7 +557,7 b' class hgweb:' | |||||
563 | i = self.repo.tagslist() |
|
557 | i = self.repo.tagslist() | |
564 | i.reverse() |
|
558 | i.reverse() | |
565 |
|
559 | |||
566 | def entries(): |
|
560 | def entries(**map): | |
567 | parity = 0 |
|
561 | parity = 0 | |
568 | for k,n in i: |
|
562 | for k,n in i: | |
569 | yield self.t("tagentry", |
|
563 | yield self.t("tagentry", | |
@@ -583,7 +577,7 b' class hgweb:' | |||||
583 | cs = cl.read(n) |
|
577 | cs = cl.read(n) | |
584 | mf = self.repo.manifest.read(cs[0]) |
|
578 | mf = self.repo.manifest.read(cs[0]) | |
585 |
|
579 | |||
586 | def diff(): |
|
580 | def diff(**map): | |
587 | yield self.diff(p1, n, file) |
|
581 | yield self.diff(p1, n, file) | |
588 |
|
582 | |||
589 | yield self.t("filediff", |
|
583 | yield self.t("filediff", | |
@@ -600,6 +594,12 b' class hgweb:' | |||||
600 | # find tag, changeset, file |
|
594 | # find tag, changeset, file | |
601 |
|
595 | |||
602 | def run(self): |
|
596 | def run(self): | |
|
597 | def header(**map): | |||
|
598 | yield self.t("header", **map) | |||
|
599 | ||||
|
600 | def footer(**map): | |||
|
601 | yield self.t("footer", **map) | |||
|
602 | ||||
603 | self.refresh() |
|
603 | self.refresh() | |
604 | args = cgi.parse() |
|
604 | args = cgi.parse() | |
605 |
|
605 | |||
@@ -618,8 +618,8 b' class hgweb:' | |||||
618 | self.t = templater(m, self.filters, |
|
618 | self.t = templater(m, self.filters, | |
619 | {"url":url, |
|
619 | {"url":url, | |
620 | "repo":self.reponame, |
|
620 | "repo":self.reponame, | |
621 |
"header": |
|
621 | "header":header, | |
622 |
"footer": |
|
622 | "footer":footer, | |
623 | }) |
|
623 | }) | |
624 |
|
624 | |||
625 | if not args.has_key('cmd') or args['cmd'][0] == 'changelog': |
|
625 | if not args.has_key('cmd') or args['cmd'][0] == 'changelog': |
General Comments 0
You need to be logged in to leave comments.
Login now