Mercurial ignores color expansion for a given output pattern

How do I get a mercury color extension if the style (including the default) is specified on the command line or in ~/.hgrc ?

My ~/.hgrc looks like

 [extensions] color= [color] log.changeset=yellow 

When I do hg log , the changeset lines are highlighted in yellow as expected, for example

 changeset: 399:c42d2627824f <----- THIS LINE IS IN YELLOW :-) user: A User < user@example.com > date: Tue Jun 21 11:07:17 2011 +0200 summary: add code to rm -rf / 

However, if I do hg log --style=default , the output is identical, but the change set lines are no longer highlighted.

You can say: "well, do not specify --style=default !"

Unfortunately, this is a problem because my goal is to set up a default template. I made a copy of the template, called it map-cmdline.default2 and whether I performed hg log --style=default2 or added style=default2 to my ~/.hgrc , the color highlighting is disabled.

+6
source share
1 answer

You have found that Mercurial cheats: hg log does not use a template system, the output is hard-coded. The --style flag triggers a slower (but customizable) template engine.

Changing this will probably be difficult, but I agree with Oben that you should open the question about this.

+4
source

Source: https://habr.com/ru/post/891100/


All Articles