HomePhabricator

templatespec: create a factory function for each type there is

Authored by martinvonz.

Description

templatespec: create a factory function for each type there is

Most of the arguments to the templatespec constructor are mutually
exclusive, so each combination creates a different type of
templatespec. Let's clarify that by creating factory functions.

I've left the callers in logcmdutil unchanged for now because they
are more complex and logcmdutil.templatespec() is slightly higher
level in that it is specific to changesets.

My larger goal is to add support frozen binaries (specifically
PyOxidizer) by adding a specific type of templatespec for built-in
templates. That will get its own factory function.

Differential Revision: https://phab.mercurial-scm.org/D8845

Details