This is an archive of the discontinued Mercurial Phabricator instance.

hgweb: add a sendtemplate() helper function
ClosedPublic

Authored by indygreg on Mar 11 2018, 12:24 AM.

Details

Summary

This pattern is common. Let's make a helper function to reduce
boilerplate.

We store the "global" template on the requestcontext instance and
use it. The templater used by the helper function is the same
templater that's passed in as an argument to the @webcommand
functions. It needs to be this way because various commands are
accessing and mutating the defaults on the templater instance.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Mar 11 2018, 12:24 AM
durin42 accepted this revision.Mar 12 2018, 5:16 PM
This revision is now accepted and ready to land.Mar 12 2018, 5:16 PM
This revision was automatically updated to reflect the committed changes.