From at least version 1.3.1 onwards, it looks like mercurial will colourize the output of commands like “hg diff” (for instance), making them much easier to read on-screen.
However, when it detects that output is going to a pipe rather than a terminal, it normally turns colourization off.
You can turn it back on using the “–color=always” argument; and if you’re piping to “less”, then “less -R” will cause it to recognize ANSI colour escape sequences. For example:
hg diff --color=always | less -R
Advertisement