Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial ignores color extension when an output template is specified

How do I get the mercurial color extension to work when a 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, e.g.

changeset:   399:c42d2627824f <----- THIS LINE IS IN YELLOW :-)
user:        A User <[email protected]>
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 changeset lines are no longer highlighted.

You may say, "well, don't specify --style=default!"

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

like image 748
mike Avatar asked Jun 22 '11 10:06

mike


1 Answers

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

Changing this would probably be difficult, but I agree with Oben that you should open an issue about this.

like image 151
Martin Geisler Avatar answered Nov 15 '22 09:11

Martin Geisler