[PATCH] templater: add template path to __base__ search

Matt Mackall mpm at selenic.com
Fri Aug 26 05:43:10 EDT 2016


On Fri, 2016-08-26 at 11:23 +0200, Pierre-Yves David wrote:
> 
> On 08/25/2016 02:48 AM, Matt Mackall wrote:
> > 
> > # HG changeset patch
> > # User Matt Mackall <mpm at selenic.com>
> > # Date 1472085825 25200
> > #      Wed Aug 24 17:43:45 2016 -0700
> > # Node ID 1ec871261bb777e24f21cb180fce199cb49c55ea
> > # Parent  5f86818c95e5ea59c48dfceca2e286cd11f9a800
> > templater: add template path to __base__ search
> > 
> > This does a fall-back check for style files or directories that are
> > in Mercurial's template path for user convenience.
> So this seems to mean we are looking for __base__ the same way we search 
> for style. This seems very sensible.
> 
> > 
> > We intentionally don't use this for the built-in coal style because we don't
> > want the style to mysteriously break if the working directory just
> > happens to have a file named "paper".
> I'm a bit more confused here. First, I would imagine our search priority 
> would help two style next to each other be able to to work together. 
> Second, does this means the working directory is in the template search 
> path? If so how is it not an issue already?

> The new feature is definitly neat and shiny, but if -we- cannot even use 
> it for our most common template this looks like an hatching disaster.

Scenario I'm slightly worried about:

- someone has a working hgweb setup with coal, has never heard of "paper"
- a file named "paper" gets added to hgweb working directory (improbable)
- coal theme mysteriously stops working due to action at a distance

Scenario I'm not worried about:

- user creates a new style that derives from paper
- user now has knowledge of how templater works and the significance of "paper"
- a file named "paper" gets added to hgweb working directory
- system breaks, but it's much less mysterious

The first scenario is unlikely, but we might as well avoid it.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list