Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 18581:3490c91a1fcb
templates: export extra as a dict to templates
Currently only useful with the json filter.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 08 Feb 2013 21:55:46 +0100 |
parents | 6d098adc5a46 |
children | 76ff3a715cf2 |
comparison
equal
deleted
inserted
replaced
18576:97761496c65a | 18581:3490c91a1fcb |
---|---|
87 rev=fctx.rev(), | 87 rev=fctx.rev(), |
88 node=fctx.hex(), | 88 node=fctx.hex(), |
89 author=fctx.user(), | 89 author=fctx.user(), |
90 date=fctx.date(), | 90 date=fctx.date(), |
91 desc=fctx.description(), | 91 desc=fctx.description(), |
92 extra=fctx.extra(), | |
92 branch=webutil.nodebranchnodefault(fctx), | 93 branch=webutil.nodebranchnodefault(fctx), |
93 parent=webutil.parents(fctx), | 94 parent=webutil.parents(fctx), |
94 child=webutil.children(fctx), | 95 child=webutil.children(fctx), |
95 rename=webutil.renamelink(fctx), | 96 rename=webutil.renamelink(fctx), |
96 permissions=fctx.manifest().flags(f)) | 97 permissions=fctx.manifest().flags(f)) |
160 author=ctx.user(), | 161 author=ctx.user(), |
161 parent=webutil.parents(ctx), | 162 parent=webutil.parents(ctx), |
162 child=webutil.children(ctx), | 163 child=webutil.children(ctx), |
163 changelogtag=showtags, | 164 changelogtag=showtags, |
164 desc=ctx.description(), | 165 desc=ctx.description(), |
166 extra=ctx.extra(), | |
165 date=ctx.date(), | 167 date=ctx.date(), |
166 files=files, | 168 files=files, |
167 rev=ctx.rev(), | 169 rev=ctx.rev(), |
168 node=hex(n), | 170 node=hex(n), |
169 tags=webutil.nodetagsdict(web.repo, n), | 171 tags=webutil.nodetagsdict(web.repo, n), |
214 "author": ctx.user(), | 216 "author": ctx.user(), |
215 "parent": webutil.parents(ctx, i - 1), | 217 "parent": webutil.parents(ctx, i - 1), |
216 "child": webutil.children(ctx, i + 1), | 218 "child": webutil.children(ctx, i + 1), |
217 "changelogtag": showtags, | 219 "changelogtag": showtags, |
218 "desc": ctx.description(), | 220 "desc": ctx.description(), |
221 "extra": ctx.extra(), | |
219 "date": ctx.date(), | 222 "date": ctx.date(), |
220 "files": files, | 223 "files": files, |
221 "rev": i, | 224 "rev": i, |
222 "node": hex(n), | 225 "node": hex(n), |
223 "tags": webutil.nodetagsdict(web.repo, n), | 226 "tags": webutil.nodetagsdict(web.repo, n), |
297 changesettag=showtags, | 300 changesettag=showtags, |
298 changesetbookmark=showbookmarks, | 301 changesetbookmark=showbookmarks, |
299 changesetbranch=showbranch, | 302 changesetbranch=showbranch, |
300 author=ctx.user(), | 303 author=ctx.user(), |
301 desc=ctx.description(), | 304 desc=ctx.description(), |
305 extra=ctx.extra(), | |
302 date=ctx.date(), | 306 date=ctx.date(), |
303 files=files, | 307 files=files, |
304 diffsummary=lambda **x: webutil.diffsummary(diffstatgen), | 308 diffsummary=lambda **x: webutil.diffsummary(diffstatgen), |
305 diffstat=diffstat, | 309 diffstat=diffstat, |
306 archives=web.archivelist(ctx.hex()), | 310 archives=web.archivelist(ctx.hex()), |
529 l.append(tmpl( | 533 l.append(tmpl( |
530 'shortlogentry', | 534 'shortlogentry', |
531 parity=parity.next(), | 535 parity=parity.next(), |
532 author=ctx.user(), | 536 author=ctx.user(), |
533 desc=ctx.description(), | 537 desc=ctx.description(), |
538 extra=ctx.extra(), | |
534 date=ctx.date(), | 539 date=ctx.date(), |
535 rev=i, | 540 rev=i, |
536 node=hn, | 541 node=hn, |
537 tags=webutil.nodetagsdict(web.repo, n), | 542 tags=webutil.nodetagsdict(web.repo, n), |
538 bookmarks=webutil.nodebookmarksdict(web.repo, n), | 543 bookmarks=webutil.nodebookmarksdict(web.repo, n), |
588 file=path, | 593 file=path, |
589 node=hex(n), | 594 node=hex(n), |
590 rev=ctx.rev(), | 595 rev=ctx.rev(), |
591 date=ctx.date(), | 596 date=ctx.date(), |
592 desc=ctx.description(), | 597 desc=ctx.description(), |
598 extra=ctx.extra(), | |
593 author=ctx.user(), | 599 author=ctx.user(), |
594 rename=rename, | 600 rename=rename, |
595 branch=webutil.nodebranchnodefault(ctx), | 601 branch=webutil.nodebranchnodefault(ctx), |
596 parent=webutil.parents(ctx), | 602 parent=webutil.parents(ctx), |
597 child=webutil.children(ctx), | 603 child=webutil.children(ctx), |
649 file=path, | 655 file=path, |
650 node=hex(ctx.node()), | 656 node=hex(ctx.node()), |
651 rev=ctx.rev(), | 657 rev=ctx.rev(), |
652 date=ctx.date(), | 658 date=ctx.date(), |
653 desc=ctx.description(), | 659 desc=ctx.description(), |
660 extra=ctx.extra(), | |
654 author=ctx.user(), | 661 author=ctx.user(), |
655 rename=rename, | 662 rename=rename, |
656 branch=webutil.nodebranchnodefault(ctx), | 663 branch=webutil.nodebranchnodefault(ctx), |
657 parent=webutil.parents(fctx), | 664 parent=webutil.parents(fctx), |
658 child=webutil.children(fctx), | 665 child=webutil.children(fctx), |
687 yield {"parity": parity.next(), | 694 yield {"parity": parity.next(), |
688 "node": f.hex(), | 695 "node": f.hex(), |
689 "rev": f.rev(), | 696 "rev": f.rev(), |
690 "author": f.user(), | 697 "author": f.user(), |
691 "desc": f.description(), | 698 "desc": f.description(), |
699 "extra": f.extra(), | |
692 "file": f.path(), | 700 "file": f.path(), |
693 "targetline": targetline, | 701 "targetline": targetline, |
694 "line": l, | 702 "line": l, |
695 "lineid": "l%d" % (lineno + 1), | 703 "lineid": "l%d" % (lineno + 1), |
696 "linenumber": "% 6d" % (lineno + 1), | 704 "linenumber": "% 6d" % (lineno + 1), |
703 rev=fctx.rev(), | 711 rev=fctx.rev(), |
704 node=fctx.hex(), | 712 node=fctx.hex(), |
705 author=fctx.user(), | 713 author=fctx.user(), |
706 date=fctx.date(), | 714 date=fctx.date(), |
707 desc=fctx.description(), | 715 desc=fctx.description(), |
716 extra=fctx.extra(), | |
708 rename=webutil.renamelink(fctx), | 717 rename=webutil.renamelink(fctx), |
709 branch=webutil.nodebranchnodefault(fctx), | 718 branch=webutil.nodebranchnodefault(fctx), |
710 parent=webutil.parents(fctx), | 719 parent=webutil.parents(fctx), |
711 child=webutil.children(fctx), | 720 child=webutil.children(fctx), |
712 permissions=fctx.manifest().flags(f)) | 721 permissions=fctx.manifest().flags(f)) |
768 "date": iterfctx.date(), | 777 "date": iterfctx.date(), |
769 "rename": webutil.renamelink(iterfctx), | 778 "rename": webutil.renamelink(iterfctx), |
770 "parent": webutil.parents(iterfctx), | 779 "parent": webutil.parents(iterfctx), |
771 "child": webutil.children(iterfctx), | 780 "child": webutil.children(iterfctx), |
772 "desc": iterfctx.description(), | 781 "desc": iterfctx.description(), |
782 "extra": iterfctx.extra(), | |
773 "tags": webutil.nodetagsdict(repo, iterfctx.node()), | 783 "tags": webutil.nodetagsdict(repo, iterfctx.node()), |
774 "bookmarks": webutil.nodebookmarksdict( | 784 "bookmarks": webutil.nodebookmarksdict( |
775 repo, iterfctx.node()), | 785 repo, iterfctx.node()), |
776 "branch": webutil.nodebranchnodefault(iterfctx), | 786 "branch": webutil.nodebranchnodefault(iterfctx), |
777 "inbranch": webutil.nodeinbranch(repo, iterfctx), | 787 "inbranch": webutil.nodeinbranch(repo, iterfctx), |