Mercurial > public > mercurial-scm > hg
diff mercurial/hgweb/webcommands.py @ 36885:c68e79dcf21c
hgweb: don't redundantly pass templater with requestcontext (API)
The requestcontenxt has a ``tmpl`` attribute to access the
templater. We don't need to pass the templater explicitly when
passing a requestcontext instance.
.. api::
Various helper functions in hgweb.webutil no longer accept a
templater instance. Access the templater through the
``web`` argument instead.
Differential Revision: https://phab.mercurial-scm.org/D2801
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 10 Mar 2018 19:46:54 -0800 |
parents | ece242db5000 |
children | 563fd95a6efb |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Sat Mar 10 20:38:28 2018 -0800 +++ b/mercurial/hgweb/webcommands.py Sat Mar 10 19:46:54 2018 -0800 @@ -399,7 +399,7 @@ if curcount > revcount + 1: break - entry = webutil.changelistentry(web, web.repo[rev], web.tmpl) + entry = webutil.changelistentry(web, web.repo[rev]) entry['parity'] = next(parity) yield entry @@ -485,7 +485,7 @@ return web.sendtemplate( 'changeset', - **webutil.changesetentry(web, req, web.tmpl, ctx)) + **webutil.changesetentry(web, req, ctx)) rev = webcommand('rev')(changeset) @@ -808,7 +808,7 @@ if 'style' in web.req.qsparams: style = web.req.qsparams['style'] - diffs = webutil.diffs(web, web.tmpl, ctx, basectx, [path], style) + diffs = webutil.diffs(web, ctx, basectx, [path], style) if fctx is not None: rename = webutil.renamelink(fctx) ctx = fctx @@ -1066,7 +1066,7 @@ ctx = fctx.changectx() basectx = ctx.p1() path = fctx.path() - return webutil.diffs(web, web.tmpl, ctx, basectx, [path], diffstyle, + return webutil.diffs(web, ctx, basectx, [path], diffstyle, linerange=linerange, lineidprefix='%s-' % ctx.hex()[:12])