Color extension is enabled in mercurial configuration file. So when you change files in repository and use 'hg diff' all changes are highlighted with colors. When you add changes in sub-repository and enter 'hg diff' from main repository folder all the diffrerences in sub repositories are shown without colors.
Do you have color enabled globally or just in the main repo? Do you have any reason to think your issue is Windows-specific?
I have color enabled globally. I'm using Windows that's why I posted bug only for Windows, I don't know whether this bug is reproducible on *nix systems.
Ok, adding some people who might have ideas. Can you test if the problem exists with 2.3.x, please?
I can reproduce this issue with Mercurial 2.4(64bit) on Windows7. Below versions can colorize diff of subrepo well on same environment: - Mercurial 2.3(64bit) - Mercurial 2.3.2 bundled with TortoiseHg(64bit) diff of subrepo is not colorized, even though color extension is enabled in .hg/hgrc of subrepository. in all cases, diff of parent is colorized well. (In reply to comment #3)
Mercurial 2.3 on Windows x64 is working correctly.
I found cause of this issue. Colorization is achieved by overriding the class of "ui" object at command dispatching. http://selenic.com/repo/hg/file/e853d27956fb/hgext/color.py#l358 But "diff()" of hgsubrepo passes "self._repo.ui" to "cmdutil.diffordiffstat()": it is created from "baseui" of parent repo, and plain one. So, output of "cmdutil.diffordiffstat()" for subrepo is not colorized. "status()" of hgsubrepo doesn't take "ui" argument, too. But it works well for colorization of subrepo status, because "status()" of hgsubrepo only returns status information: writing out is done with colorized "ui" on the caller side. I'll post the patch to fix this issue by adding "ui" argument to "diff()" of subrepo. BTW, trigger of this issue is 573bec4ab7ba: it's mine :-<
Fixed by http://selenic.com/repo/hg/rev/0c10cf819146 FUJIWARA Katsunori <foozy@lares.dti.ne.jp> subrepo: add argument to "diff()" to pass "ui" of caller side (issue3712) (API) Color extension achieves colorization by overriding the class of "ui" object just before command execution. Before this patch, "diff()" of abstractsubrepo and classes derived from it has no "ui" argument, so "diff()" of hgsubrepo uses "self._repo.ui" to invoke "cmdutil.diffordiffstat()". For separation of configuration between repositories, revision 573bec4ab7ba changed the initialization source of "self._repo.ui" from "ui"(overridden) to "baseui"(plain) of parent repository. And this caused break of colorization. This patch adds "ui" argument to "diff()" of abstractsubrepo and classes derived from it to pass "ui" object of caller side. (please test the fix)