Show More
@@ -145,20 +145,10 b' def _filerevision(web, req, tmpl, fctx):' | |||||
145 | file=f, |
|
145 | file=f, | |
146 | path=webutil.up(f), |
|
146 | path=webutil.up(f), | |
147 | text=lines(), |
|
147 | text=lines(), | |
148 | rev=fctx.rev(), |
|
|||
149 | symrev=webutil.symrevorshortnode(req, fctx), |
|
148 | symrev=webutil.symrevorshortnode(req, fctx), | |
150 | node=fctx.hex(), |
|
|||
151 | author=fctx.user(), |
|
|||
152 | date=fctx.date(), |
|
|||
153 | desc=fctx.description(), |
|
|||
154 | extra=fctx.extra(), |
|
|||
155 | branch=webutil.nodebranchnodefault(fctx), |
|
|||
156 | parent=webutil.parents(fctx), |
|
|||
157 | child=webutil.children(fctx), |
|
|||
158 | rename=webutil.renamelink(fctx), |
|
149 | rename=webutil.renamelink(fctx), | |
159 | tags=webutil.nodetagsdict(web.repo, fctx.node()), |
|
150 | permissions=fctx.manifest().flags(f), | |
160 |
|
|
151 | **webutil.commonentry(web.repo, fctx)) | |
161 | permissions=fctx.manifest().flags(f)) |
|
|||
162 |
|
152 | |||
163 | @webcommand('file') |
|
153 | @webcommand('file') | |
164 | def file(web, req, tmpl): |
|
154 | def file(web, req, tmpl): | |
@@ -289,20 +279,9 b' def _search(web, req, tmpl):' | |||||
289 |
|
279 | |||
290 | yield tmpl('searchentry', |
|
280 | yield tmpl('searchentry', | |
291 | parity=parity.next(), |
|
281 | parity=parity.next(), | |
292 | author=ctx.user(), |
|
|||
293 | parent=lambda **x: webutil.parents(ctx), |
|
|||
294 | child=lambda **x: webutil.children(ctx), |
|
|||
295 | changelogtag=showtags, |
|
282 | changelogtag=showtags, | |
296 | desc=ctx.description(), |
|
|||
297 | extra=ctx.extra(), |
|
|||
298 | date=ctx.date(), |
|
|||
299 | files=files, |
|
283 | files=files, | |
300 | rev=ctx.rev(), |
|
284 | **webutil.commonentry(web.repo, ctx)) | |
301 | node=hex(n), |
|
|||
302 | tags=webutil.nodetagsdict(web.repo, n), |
|
|||
303 | bookmarks=webutil.nodebookmarksdict(web.repo, n), |
|
|||
304 | inbranch=webutil.nodeinbranch(web.repo, ctx), |
|
|||
305 | branches=webutil.nodebranchdict(web.repo, ctx)) |
|
|||
306 |
|
285 | |||
307 | if count >= revcount: |
|
286 | if count >= revcount: | |
308 | break |
|
287 | break | |
@@ -572,20 +551,14 b' def manifest(web, req, tmpl):' | |||||
572 | "basename": d} |
|
551 | "basename": d} | |
573 |
|
552 | |||
574 | return tmpl("manifest", |
|
553 | return tmpl("manifest", | |
575 | rev=ctx.rev(), |
|
|||
576 | symrev=symrev, |
|
554 | symrev=symrev, | |
577 | node=hex(node), |
|
|||
578 | path=abspath, |
|
555 | path=abspath, | |
579 | up=webutil.up(abspath), |
|
556 | up=webutil.up(abspath), | |
580 | upparity=parity.next(), |
|
557 | upparity=parity.next(), | |
581 | fentries=filelist, |
|
558 | fentries=filelist, | |
582 | dentries=dirlist, |
|
559 | dentries=dirlist, | |
583 | archives=web.archivelist(hex(node)), |
|
560 | archives=web.archivelist(hex(node)), | |
584 |
|
|
561 | **webutil.commonentry(web.repo, ctx)) | |
585 | bookmarks=webutil.nodebookmarksdict(web.repo, node), |
|
|||
586 | branch=webutil.nodebranchnodefault(ctx), |
|
|||
587 | inbranch=webutil.nodeinbranch(web.repo, ctx), |
|
|||
588 | branches=webutil.nodebranchdict(web.repo, ctx)) |
|
|||
589 |
|
562 | |||
590 | @webcommand('tags') |
|
563 | @webcommand('tags') | |
591 | def tags(web, req, tmpl): |
|
564 | def tags(web, req, tmpl): | |
@@ -719,22 +692,11 b' def summary(web, req, tmpl):' | |||||
719 | revs = web.repo.changelog.revs(start, end - 1) |
|
692 | revs = web.repo.changelog.revs(start, end - 1) | |
720 | for i in revs: |
|
693 | for i in revs: | |
721 | ctx = web.repo[i] |
|
694 | ctx = web.repo[i] | |
722 | n = ctx.node() |
|
|||
723 | hn = hex(n) |
|
|||
724 |
|
695 | |||
725 | l.append(tmpl( |
|
696 | l.append(tmpl( | |
726 | 'shortlogentry', |
|
697 | 'shortlogentry', | |
727 | parity=parity.next(), |
|
698 | parity=parity.next(), | |
728 | author=ctx.user(), |
|
699 | **webutil.commonentry(web.repo, ctx))) | |
729 | desc=ctx.description(), |
|
|||
730 | extra=ctx.extra(), |
|
|||
731 | date=ctx.date(), |
|
|||
732 | rev=i, |
|
|||
733 | node=hn, |
|
|||
734 | tags=webutil.nodetagsdict(web.repo, n), |
|
|||
735 | bookmarks=webutil.nodebookmarksdict(web.repo, n), |
|
|||
736 | inbranch=webutil.nodeinbranch(web.repo, ctx), |
|
|||
737 | branches=webutil.nodebranchdict(web.repo, ctx))) |
|
|||
738 |
|
700 | |||
739 | l.reverse() |
|
701 | l.reverse() | |
740 | yield l |
|
702 | yield l | |
@@ -779,12 +741,8 b' def filediff(web, req, tmpl):' | |||||
779 | raise |
|
741 | raise | |
780 |
|
742 | |||
781 | if fctx is not None: |
|
743 | if fctx is not None: | |
782 | n = fctx.node() |
|
|||
783 | path = fctx.path() |
|
744 | path = fctx.path() | |
784 | ctx = fctx.changectx() |
|
745 | ctx = fctx.changectx() | |
785 | else: |
|
|||
786 | n = ctx.node() |
|
|||
787 | # path already defined in except clause |
|
|||
788 |
|
746 | |||
789 | parity = paritygen(web.stripecount) |
|
747 | parity = paritygen(web.stripecount) | |
790 | style = web.config('web', 'style', 'paper') |
|
748 | style = web.config('web', 'style', 'paper') | |
@@ -800,20 +758,10 b' def filediff(web, req, tmpl):' | |||||
800 | ctx = ctx |
|
758 | ctx = ctx | |
801 | return tmpl("filediff", |
|
759 | return tmpl("filediff", | |
802 | file=path, |
|
760 | file=path, | |
803 | node=hex(n), |
|
|||
804 | rev=ctx.rev(), |
|
|||
805 | symrev=webutil.symrevorshortnode(req, ctx), |
|
761 | symrev=webutil.symrevorshortnode(req, ctx), | |
806 | date=ctx.date(), |
|
|||
807 | desc=ctx.description(), |
|
|||
808 | extra=ctx.extra(), |
|
|||
809 | author=ctx.user(), |
|
|||
810 | rename=rename, |
|
762 | rename=rename, | |
811 | branch=webutil.nodebranchnodefault(ctx), |
|
763 | diff=diffs, | |
812 |
|
|
764 | **webutil.commonentry(web.repo, ctx)) | |
813 | child=webutil.children(ctx), |
|
|||
814 | tags=webutil.nodetagsdict(web.repo, n), |
|
|||
815 | bookmarks=webutil.nodebookmarksdict(web.repo, n), |
|
|||
816 | diff=diffs) |
|
|||
817 |
|
765 | |||
818 | diff = webcommand('diff')(filediff) |
|
766 | diff = webcommand('diff')(filediff) | |
819 |
|
767 | |||
@@ -881,24 +829,14 b' def comparison(web, req, tmpl):' | |||||
881 | ctx = ctx |
|
829 | ctx = ctx | |
882 | return tmpl('filecomparison', |
|
830 | return tmpl('filecomparison', | |
883 | file=path, |
|
831 | file=path, | |
884 | node=hex(ctx.node()), |
|
|||
885 | rev=ctx.rev(), |
|
|||
886 | symrev=webutil.symrevorshortnode(req, ctx), |
|
832 | symrev=webutil.symrevorshortnode(req, ctx), | |
887 | date=ctx.date(), |
|
|||
888 | desc=ctx.description(), |
|
|||
889 | extra=ctx.extra(), |
|
|||
890 | author=ctx.user(), |
|
|||
891 | rename=rename, |
|
833 | rename=rename, | |
892 | branch=webutil.nodebranchnodefault(ctx), |
|
|||
893 | parent=webutil.parents(ctx), |
|
|||
894 | child=webutil.children(ctx), |
|
|||
895 | tags=webutil.nodetagsdict(web.repo, ctx.node()), |
|
|||
896 | bookmarks=webutil.nodebookmarksdict(web.repo, ctx.node()), |
|
|||
897 | leftrev=leftrev, |
|
834 | leftrev=leftrev, | |
898 | leftnode=hex(leftnode), |
|
835 | leftnode=hex(leftnode), | |
899 | rightrev=rightrev, |
|
836 | rightrev=rightrev, | |
900 | rightnode=hex(rightnode), |
|
837 | rightnode=hex(rightnode), | |
901 |
comparison=comparison |
|
838 | comparison=comparison, | |
|
839 | **webutil.commonentry(web.repo, ctx)) | |||
902 |
|
840 | |||
903 | @webcommand('annotate') |
|
841 | @webcommand('annotate') | |
904 | def annotate(web, req, tmpl): |
|
842 | def annotate(web, req, tmpl): | |
@@ -950,20 +888,10 b' def annotate(web, req, tmpl):' | |||||
950 | file=f, |
|
888 | file=f, | |
951 | annotate=annotate, |
|
889 | annotate=annotate, | |
952 | path=webutil.up(f), |
|
890 | path=webutil.up(f), | |
953 | rev=fctx.rev(), |
|
|||
954 | symrev=webutil.symrevorshortnode(req, fctx), |
|
891 | symrev=webutil.symrevorshortnode(req, fctx), | |
955 | node=fctx.hex(), |
|
|||
956 | author=fctx.user(), |
|
|||
957 | date=fctx.date(), |
|
|||
958 | desc=fctx.description(), |
|
|||
959 | extra=fctx.extra(), |
|
|||
960 | rename=webutil.renamelink(fctx), |
|
892 | rename=webutil.renamelink(fctx), | |
961 | branch=webutil.nodebranchnodefault(fctx), |
|
893 | permissions=fctx.manifest().flags(f), | |
962 |
|
|
894 | **webutil.commonentry(web.repo, fctx)) | |
963 | child=webutil.children(fctx), |
|
|||
964 | tags=webutil.nodetagsdict(web.repo, fctx.node()), |
|
|||
965 | bookmarks=webutil.nodebookmarksdict(web.repo, fctx.node()), |
|
|||
966 | permissions=fctx.manifest().flags(f)) |
|
|||
967 |
|
895 | |||
968 | @webcommand('filelog') |
|
896 | @webcommand('filelog') | |
969 | def filelog(web, req, tmpl): |
|
897 | def filelog(web, req, tmpl): | |
@@ -1025,23 +953,12 b' def filelog(web, req, tmpl):' | |||||
1025 | for i in revs: |
|
953 | for i in revs: | |
1026 | iterfctx = fctx.filectx(i) |
|
954 | iterfctx = fctx.filectx(i) | |
1027 |
|
955 | |||
1028 |
l.append( |
|
956 | l.append(dict( | |
1029 | "filerev": i, |
|
957 | parity=parity.next(), | |
1030 |
|
|
958 | filerev=i, | |
1031 | "node": iterfctx.hex(), |
|
959 | file=f, | |
1032 |
|
|
960 | rename=webutil.renamelink(iterfctx), | |
1033 | "date": iterfctx.date(), |
|
961 | **webutil.commonentry(repo, iterfctx))) | |
1034 | "rename": webutil.renamelink(iterfctx), |
|
|||
1035 | "parent": lambda **x: webutil.parents(iterfctx), |
|
|||
1036 | "child": lambda **x: webutil.children(iterfctx), |
|
|||
1037 | "desc": iterfctx.description(), |
|
|||
1038 | "extra": iterfctx.extra(), |
|
|||
1039 | "tags": webutil.nodetagsdict(repo, iterfctx.node()), |
|
|||
1040 | "bookmarks": webutil.nodebookmarksdict( |
|
|||
1041 | repo, iterfctx.node()), |
|
|||
1042 | "branch": webutil.nodebranchnodefault(iterfctx), |
|
|||
1043 | "inbranch": webutil.nodeinbranch(repo, iterfctx), |
|
|||
1044 | "branches": webutil.nodebranchdict(repo, iterfctx)}) |
|
|||
1045 | for e in reversed(l): |
|
962 | for e in reversed(l): | |
1046 | yield e |
|
963 | yield e | |
1047 |
|
964 | |||
@@ -1050,15 +967,16 b' def filelog(web, req, tmpl):' | |||||
1050 |
|
967 | |||
1051 | revnav = webutil.filerevnav(web.repo, fctx.path()) |
|
968 | revnav = webutil.filerevnav(web.repo, fctx.path()) | |
1052 | nav = revnav.gen(end - 1, revcount, count) |
|
969 | nav = revnav.gen(end - 1, revcount, count) | |
1053 |
return tmpl("filelog", |
|
970 | return tmpl("filelog", | |
1054 |
|
|
971 | file=f, | |
|
972 | nav=nav, | |||
1055 | symrev=webutil.symrevorshortnode(req, fctx), |
|
973 | symrev=webutil.symrevorshortnode(req, fctx), | |
1056 | branch=webutil.nodebranchnodefault(fctx), |
|
|||
1057 | tags=webutil.nodetagsdict(web.repo, fctx.node()), |
|
|||
1058 | bookmarks=webutil.nodebookmarksdict(web.repo, fctx.node()), |
|
|||
1059 | entries=entries, |
|
974 | entries=entries, | |
1060 | latestentry=latestentry, |
|
975 | latestentry=latestentry, | |
1061 |
revcount=revcount, |
|
976 | revcount=revcount, | |
|
977 | morevars=morevars, | |||
|
978 | lessvars=lessvars, | |||
|
979 | **webutil.commonentry(web.repo, fctx)) | |||
1062 |
|
980 | |||
1063 | @webcommand('archive') |
|
981 | @webcommand('archive') | |
1064 | def archive(web, req, tmpl): |
|
982 | def archive(web, req, tmpl): |
@@ -308,6 +308,25 b' def filectx(repo, req):' | |||||
308 |
|
308 | |||
309 | return fctx |
|
309 | return fctx | |
310 |
|
310 | |||
|
311 | def commonentry(repo, ctx): | |||
|
312 | node = ctx.node() | |||
|
313 | return { | |||
|
314 | 'rev': ctx.rev(), | |||
|
315 | 'node': hex(node), | |||
|
316 | 'author': ctx.user(), | |||
|
317 | 'desc': ctx.description(), | |||
|
318 | 'date': ctx.date(), | |||
|
319 | 'extra': ctx.extra(), | |||
|
320 | 'phase': ctx.phasestr(), | |||
|
321 | 'branch': nodebranchnodefault(ctx), | |||
|
322 | 'inbranch': nodeinbranch(repo, ctx), | |||
|
323 | 'branches': nodebranchdict(repo, ctx), | |||
|
324 | 'tags': nodetagsdict(repo, node), | |||
|
325 | 'bookmarks': nodebookmarksdict(repo, node), | |||
|
326 | 'parent': lambda **x: parents(ctx), | |||
|
327 | 'child': lambda **x: children(ctx), | |||
|
328 | } | |||
|
329 | ||||
311 | def changelistentry(web, ctx, tmpl): |
|
330 | def changelistentry(web, ctx, tmpl): | |
312 | '''Obtain a dictionary to be used for entries in a changelist. |
|
331 | '''Obtain a dictionary to be used for entries in a changelist. | |
313 |
|
332 | |||
@@ -320,22 +339,14 b' def changelistentry(web, ctx, tmpl):' | |||||
320 | showtags = showtag(repo, tmpl, 'changelogtag', n) |
|
339 | showtags = showtag(repo, tmpl, 'changelogtag', n) | |
321 | files = listfilediffs(tmpl, ctx.files(), n, web.maxfiles) |
|
340 | files = listfilediffs(tmpl, ctx.files(), n, web.maxfiles) | |
322 |
|
341 | |||
323 | return { |
|
342 | entry = commonentry(repo, ctx) | |
324 | "author": ctx.user(), |
|
343 | entry.update( | |
325 |
|
|
344 | parent=lambda **x: parents(ctx, rev - 1), | |
326 |
|
|
345 | child=lambda **x: children(ctx, rev + 1), | |
327 |
|
|
346 | changelogtag=showtags, | |
328 | "desc": ctx.description(), |
|
347 | files=files, | |
329 | "extra": ctx.extra(), |
|
348 | ) | |
330 | "date": ctx.date(), |
|
349 | return entry | |
331 | "files": files, |
|
|||
332 | "rev": rev, |
|
|||
333 | "node": hex(n), |
|
|||
334 | "tags": nodetagsdict(repo, n), |
|
|||
335 | "bookmarks": nodebookmarksdict(repo, n), |
|
|||
336 | "inbranch": nodeinbranch(repo, ctx), |
|
|||
337 | "branches": nodebranchdict(repo, ctx) |
|
|||
338 | } |
|
|||
339 |
|
350 | |||
340 | def symrevorshortnode(req, ctx): |
|
351 | def symrevorshortnode(req, ctx): | |
341 | if 'node' in req.form: |
|
352 | if 'node' in req.form: | |
@@ -376,29 +387,16 b' def changesetentry(web, req, tmpl, ctx):' | |||||
376 |
|
387 | |||
377 | return dict( |
|
388 | return dict( | |
378 | diff=diff, |
|
389 | diff=diff, | |
379 | rev=ctx.rev(), |
|
|||
380 | node=ctx.hex(), |
|
|||
381 | symrev=symrevorshortnode(req, ctx), |
|
390 | symrev=symrevorshortnode(req, ctx), | |
382 | parent=parents(ctx), |
|
|||
383 | child=children(ctx), |
|
|||
384 | basenode=basectx.hex(), |
|
391 | basenode=basectx.hex(), | |
385 | changesettag=showtags, |
|
392 | changesettag=showtags, | |
386 | changesetbookmark=showbookmarks, |
|
393 | changesetbookmark=showbookmarks, | |
387 | changesetbranch=showbranch, |
|
394 | changesetbranch=showbranch, | |
388 | author=ctx.user(), |
|
|||
389 | desc=ctx.description(), |
|
|||
390 | extra=ctx.extra(), |
|
|||
391 | date=ctx.date(), |
|
|||
392 | phase=ctx.phasestr(), |
|
|||
393 | files=files, |
|
395 | files=files, | |
394 | diffsummary=lambda **x: diffsummary(diffstatsgen), |
|
396 | diffsummary=lambda **x: diffsummary(diffstatsgen), | |
395 | diffstat=diffstats, |
|
397 | diffstat=diffstats, | |
396 | archives=web.archivelist(ctx.hex()), |
|
398 | archives=web.archivelist(ctx.hex()), | |
397 | tags=nodetagsdict(web.repo, ctx.node()), |
|
399 | **commonentry(web.repo, ctx)) | |
398 | bookmarks=nodebookmarksdict(web.repo, ctx.node()), |
|
|||
399 | branch=showbranch, |
|
|||
400 | inbranch=nodeinbranch(web.repo, ctx), |
|
|||
401 | branches=nodebranchdict(web.repo, ctx)) |
|
|||
402 |
|
400 | |||
403 | def listfilediffs(tmpl, files, node, max): |
|
401 | def listfilediffs(tmpl, files, node, max): | |
404 | for f in files[:max]: |
|
402 | for f in files[:max]: |
General Comments 0
You need to be logged in to leave comments.
Login now