Question about a general tempting plan

Matt Mackall mpm at selenic.com
Mon Feb 29 15:01:48 EST 2016


On Fri, 2016-02-26 at 16:39 +0000, Kostia Balytskyi wrote:
> Guys,
> 
> I have a question related to this topic: https://www.mercurial-scm.org/wiki/Ge
> nericTemplatingPlan
> 
> Let's say I want to implement a command. This command can be done as a version
> of `hg log` with a special enforced template.

Then how will the _user_ control the output to meet their needs? Because that is
the whole point of the templater/formatter: giving the user more flexibility.

>  Yet I am being told that formatter is a way to go and I struggle to
> understand the reason for it. I see two options:
> 1) either we're going to eventually reimplement `hg log` to use formatter
> 2) or we're going to leave `hg log` as it is since it's pretty flexible
> already

>From a user perspective, the work to add "general templating" to the existing
log-like commands is already long done. There's no plan to further unify the
internal implementation of log templating with the formatter. The point is to
bring that flexibility to all the other commands.

> In each case a command implemented as an alias to log with a special template
> will not require any additional work. So what's the problem then?

> Context: I'm looking into implementing `hg evolve --list` and it seems like
> with the right set of template keywords implemented it is a special case of
> `hg log`.

I think only two people on earth know what evolve --list is, so that doesn't add
much context.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list