Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Definitive list of Mercurial template keywords

Tags:

mercurial

I'm using hgweb.cgi and I'm setting up the notify extension so that email will be sent with each push to the server. The template setting is nice, but I can't find complete documentation anywhere. I had to guess based on bug reports or other posts that including Subject: at the beginning of the template pattern would allow me to specify the subject. I've been searching all morning (including on the Mercurial wiki) for the list of keywords Mercurial recognizes in template patterns and can't find it anywhere. Does such a list exist?

At the moment I am specifically looking for the template keyword that will translate to the name of the repo as specified in the web.name value in the repo's hgrc file. For example, if the following is specified in the .hg/hgrc file for a repo:

[web]
name = Cool Software

What keyword can I use that will be translated to "Cool Software"?

Of course, ultimately I'd really like to have the definitive list so I can write templates without having to guess the magic word.

like image 994
David Potter Avatar asked Mar 12 '11 17:03

David Potter


2 Answers

The Mercurial help system itself is usually the best source for this type of information..

In this case, you may use hg help templates to see the most up-to-date list.

like image 81
Tim Henigan Avatar answered Oct 11 '22 08:10

Tim Henigan


You can always try reading the source. For example:

  • https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/templatekw.py#l255
  • https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/templatefilters.py#l194
like image 30
OJ. Avatar answered Oct 11 '22 07:10

OJ.