开发者

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 <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 changeset lines are no longer highlighted.

You may say, 开发者_如何学JAVA"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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜