Mercurial > hg
comparison mercurial/cmdutil.py @ 18006:0c10cf819146 stable 2.4.1
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 30 Nov 2012 00:43:55 +0900 |
parents | 45bd0cd7ca04 |
children | 54f063acc5ea 153659e86a5f |
comparison
equal
deleted
inserted
replaced
17988:848345a8d6ad | 18006:0c10cf819146 |
---|---|
625 # A subrepo that existed in node1 was deleted between node1 and | 625 # A subrepo that existed in node1 was deleted between node1 and |
626 # node2 (inclusive). Thus, ctx2's substate won't contain that | 626 # node2 (inclusive). Thus, ctx2's substate won't contain that |
627 # subpath. The best we can do is to ignore it. | 627 # subpath. The best we can do is to ignore it. |
628 tempnode2 = None | 628 tempnode2 = None |
629 submatch = matchmod.narrowmatcher(subpath, match) | 629 submatch = matchmod.narrowmatcher(subpath, match) |
630 sub.diff(diffopts, tempnode2, submatch, changes=changes, | 630 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes, |
631 stat=stat, fp=fp, prefix=prefix) | 631 stat=stat, fp=fp, prefix=prefix) |
632 | 632 |
633 class changeset_printer(object): | 633 class changeset_printer(object): |
634 '''show changeset information when templating not requested.''' | 634 '''show changeset information when templating not requested.''' |
635 | 635 |