Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 36464:1fb9e01328e4
py3: use pycompat.strkwargs to convert kwargs keys to str
Differential Revision: https://phab.mercurial-scm.org/D2452
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 26 Feb 2018 16:16:37 +0530 |
parents | caa3d42f616d |
children | 24897a9d18ac |
comparison
equal
deleted
inserted
replaced
36463:433cfad4bc46 | 36464:1fb9e01328e4 |
---|---|
149 text=lines(), | 149 text=lines(), |
150 symrev=webutil.symrevorshortnode(req, fctx), | 150 symrev=webutil.symrevorshortnode(req, fctx), |
151 rename=webutil.renamelink(fctx), | 151 rename=webutil.renamelink(fctx), |
152 permissions=fctx.manifest().flags(f), | 152 permissions=fctx.manifest().flags(f), |
153 ishead=int(ishead), | 153 ishead=int(ishead), |
154 **webutil.commonentry(web.repo, fctx)) | 154 **pycompat.strkwargs(webutil.commonentry(web.repo, fctx))) |
155 | 155 |
156 @webcommand('file') | 156 @webcommand('file') |
157 def file(web, req, tmpl): | 157 def file(web, req, tmpl): |
158 """ | 158 """ |
159 /file/{revision}[/{path}] | 159 /file/{revision}[/{path}] |
282 | 282 |
283 yield tmpl('searchentry', | 283 yield tmpl('searchentry', |
284 parity=next(parity), | 284 parity=next(parity), |
285 changelogtag=showtags, | 285 changelogtag=showtags, |
286 files=files, | 286 files=files, |
287 **webutil.commonentry(web.repo, ctx)) | 287 **pycompat.strkwargs(webutil.commonentry(web.repo, ctx))) |
288 | 288 |
289 if count >= revcount: | 289 if count >= revcount: |
290 break | 290 break |
291 | 291 |
292 query = req.form['rev'][0] | 292 query = req.form['rev'][0] |
706 ctx = web.repo[i] | 706 ctx = web.repo[i] |
707 | 707 |
708 l.append(tmpl( | 708 l.append(tmpl( |
709 'shortlogentry', | 709 'shortlogentry', |
710 parity=next(parity), | 710 parity=next(parity), |
711 **webutil.commonentry(web.repo, ctx))) | 711 **pycompat.strkwargs(webutil.commonentry(web.repo, ctx)))) |
712 | 712 |
713 for entry in reversed(l): | 713 for entry in reversed(l): |
714 yield entry | 714 yield entry |
715 | 715 |
716 tip = web.repo['tip'] | 716 tip = web.repo['tip'] |
775 return tmpl("filediff", | 775 return tmpl("filediff", |
776 file=path, | 776 file=path, |
777 symrev=webutil.symrevorshortnode(req, ctx), | 777 symrev=webutil.symrevorshortnode(req, ctx), |
778 rename=rename, | 778 rename=rename, |
779 diff=diffs, | 779 diff=diffs, |
780 **webutil.commonentry(web.repo, ctx)) | 780 **pycompat.strkwargs(webutil.commonentry(web.repo, ctx))) |
781 | 781 |
782 diff = webcommand('diff')(filediff) | 782 diff = webcommand('diff')(filediff) |
783 | 783 |
784 @webcommand('comparison') | 784 @webcommand('comparison') |
785 def comparison(web, req, tmpl): | 785 def comparison(web, req, tmpl): |
850 leftrev=leftrev, | 850 leftrev=leftrev, |
851 leftnode=hex(leftnode), | 851 leftnode=hex(leftnode), |
852 rightrev=rightrev, | 852 rightrev=rightrev, |
853 rightnode=hex(rightnode), | 853 rightnode=hex(rightnode), |
854 comparison=comparison, | 854 comparison=comparison, |
855 **webutil.commonentry(web.repo, ctx)) | 855 **pycompat.strkwargs(webutil.commonentry(web.repo, ctx))) |
856 | 856 |
857 @webcommand('annotate') | 857 @webcommand('annotate') |
858 def annotate(web, req, tmpl): | 858 def annotate(web, req, tmpl): |
859 """ | 859 """ |
860 /annotate/{revision}/{path} | 860 /annotate/{revision}/{path} |
941 symrev=webutil.symrevorshortnode(req, fctx), | 941 symrev=webutil.symrevorshortnode(req, fctx), |
942 rename=webutil.renamelink(fctx), | 942 rename=webutil.renamelink(fctx), |
943 permissions=fctx.manifest().flags(f), | 943 permissions=fctx.manifest().flags(f), |
944 ishead=int(ishead), | 944 ishead=int(ishead), |
945 diffopts=diffopts, | 945 diffopts=diffopts, |
946 **webutil.commonentry(web.repo, fctx)) | 946 **pycompat.strkwargs(webutil.commonentry(web.repo, fctx))) |
947 | 947 |
948 @webcommand('filelog') | 948 @webcommand('filelog') |
949 def filelog(web, req, tmpl): | 949 def filelog(web, req, tmpl): |
950 """ | 950 """ |
951 /filelog/{revision}/{path} | 951 /filelog/{revision}/{path} |
1042 parity=next(parity), | 1042 parity=next(parity), |
1043 filerev=c.rev(), | 1043 filerev=c.rev(), |
1044 file=path, | 1044 file=path, |
1045 diff=diffs, | 1045 diff=diffs, |
1046 linerange=webutil.formatlinerange(*lr), | 1046 linerange=webutil.formatlinerange(*lr), |
1047 **webutil.commonentry(repo, c))) | 1047 **pycompat.strkwargs(webutil.commonentry(repo, c)))) |
1048 if i == revcount: | 1048 if i == revcount: |
1049 break | 1049 break |
1050 lessvars['linerange'] = webutil.formatlinerange(*lrange) | 1050 lessvars['linerange'] = webutil.formatlinerange(*lrange) |
1051 morevars['linerange'] = lessvars['linerange'] | 1051 morevars['linerange'] = lessvars['linerange'] |
1052 else: | 1052 else: |
1059 parity=next(parity), | 1059 parity=next(parity), |
1060 filerev=i, | 1060 filerev=i, |
1061 file=f, | 1061 file=f, |
1062 diff=diffs, | 1062 diff=diffs, |
1063 rename=webutil.renamelink(iterfctx), | 1063 rename=webutil.renamelink(iterfctx), |
1064 **webutil.commonentry(repo, iterfctx))) | 1064 **pycompat.strkwargs(webutil.commonentry(repo, iterfctx)))) |
1065 entries.reverse() | 1065 entries.reverse() |
1066 revnav = webutil.filerevnav(web.repo, fctx.path()) | 1066 revnav = webutil.filerevnav(web.repo, fctx.path()) |
1067 nav = revnav.gen(end - 1, revcount, count) | 1067 nav = revnav.gen(end - 1, revcount, count) |
1068 | 1068 |
1069 latestentry = entries[:1] | 1069 latestentry = entries[:1] |
1078 latestentry=latestentry, | 1078 latestentry=latestentry, |
1079 linerange=linerange, | 1079 linerange=linerange, |
1080 revcount=revcount, | 1080 revcount=revcount, |
1081 morevars=morevars, | 1081 morevars=morevars, |
1082 lessvars=lessvars, | 1082 lessvars=lessvars, |
1083 **webutil.commonentry(web.repo, fctx)) | 1083 **pycompat.strkwargs(webutil.commonentry(web.repo, fctx))) |
1084 | 1084 |
1085 @webcommand('archive') | 1085 @webcommand('archive') |
1086 def archive(web, req, tmpl): | 1086 def archive(web, req, tmpl): |
1087 """ | 1087 """ |
1088 /archive/{revision}.{format}[/{path}] | 1088 /archive/{revision}.{format}[/{path}] |