This is an archive of the discontinued Mercurial Phabricator instance.

templatespec: create a factory function for each type there is

Authored by martinvonz on Jul 29 2020, 2:38 PM.



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.

Diff Detail

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

Event Timeline

martinvonz created this revision.Jul 29 2020, 2:38 PM
martinvonz added inline comments.Jul 29 2020, 3:23 PM

Is unspecified_templatespec() better? Or maybe plain_templatespec()? It seems to result in a plainformatter getting used.

indygreg accepted this revision.Aug 2 2020, 12:14 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.

Naming is hard. I won't let this hold up review.

This revision is now accepted and ready to land.Aug 2 2020, 12:14 PM