[PATCH 0 of 5] isolate configuration of subrepos

Simon Heimberg simohe at besonet.ch
Thu Oct 4 22:02:57 CDT 2012

Subrepos get the configuration of the parent repo in several places. 
This happens because the "normal" ui is passed to the subrepo. This ui 
(which is passed around by the commands) is the same as repo.ui and 
contains repo specific configuration.

When the patch [1 of 4 V2]* of FUJIWARA Katsunori and patches 4 and 5 of 
this series are applied, this does not happen anymore. No hooks from 
containing repos will run anymore. issue2904 will be fixed.

The patch of FUJIWARA Katsunori creates the subrepo with repo.baseui and 
copies ui.commitsubrepos to the subrepo (with option to copy more 
configuration). This patch is better than my version of the same change, 
so I do not send this.

[Patch 4] calls hg.peer with repo instead of ui wherever a repo is around.
(hg.peer uses the configuration from repo.baseui when it gets a repo.)

[Pacht 5] handles the calls of hg.peer where a repo only is sometimes 
available. repo is passed when it is not null, else ui is passed. This is 
save because no configuration of a repo is included in the ui if there is 
no repo. (Almost a tautology...)

Patches 1-3 are for testing and finding the places to fix.

[Patch 1] extends a test with checking isolation of subrepo configuration. 
This is done by creating hooks in the repo and subrepo. This patch will 
probably conflict with the one form FUJIWARA Katsunori which also contains 
a test expansion. Any will do.

[Patch 2] introduces a warning message when a ui from a repository is 
passed to peer. This was the problem occurring most often. The message would 
show up also in normal running, so extension developer will also be warned. 
And in the test suite this should catch the cases test-subrepo.t leaves out. 
(Introducing this popped up many failures and it took a long time for 
rewriting the patch series.) Because every user would see the warning (only 
when there would be a wrong ui again) the message is kept short.

[Patch 3] extends the warning message when ui.debug is enabled. It appends 
a stacktrace helping the developer to locate the source of the wrong ui 

* Patch is in Email from FUJIWARA Katsunori with subject:
[PATCH 1 of 4 V2] subrepo: isolate configuration between each repositories in subrepo tree

More information about the Mercurial-devel mailing list