Bug 2904 - Hooks executed on subrepository operations
Summary: Hooks executed on subrepository operations
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-15 13:21 UTC by IsaacJurado
Modified: 2012-12-22 18:53 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description IsaacJurado 2011-07-15 13:21 UTC
Consider the following scenario: there is a repository A that contains a
subrepository S.  An preupdate hook is defined in repository A's .hg/hgrc. 
If a particular update implies also an update on S, the preupdate hook
defined for A is also executed in the context of repository S.

The only way to prevent this behaviour is to explicitly define an empty
preupdate hook in S's .hg/hgrc.

This pattern happens for all hooks whose triggering operation may imply
subrepository recurson.

Apparently, subrepository recursion merges the repository's .hg/hgrc with
its container's .hg/hgrc.
Comment 1 Matt Mackall 2011-07-15 14:57 UTC
This is slightly tricky as we may want to inherit some settings and not
others. Examples include extensions, username settings...
Comment 2 IsaacJurado 2011-07-16 04:45 UTC
Certainly.  For now, I've added some information regarding this behaviour to
the wiki:

http://mercurial.selenic.com/wiki/Subrepository#Inherited_hooks

And a link to that section from the Hook page.
Comment 3 Bugzilla 2012-05-12 09:21 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:21 EDT  ---

This bug was previously known as _bug_ 2904 at http://mercurial.selenic.com/bts/issue2904
Comment 4 HG Bot 2012-10-27 18:13 UTC
Fixed by http://selenic.com/repo/hg/rev/f4ee2e959696
Simon Heimberg <simohe@besonet.ch>
subrepo: subrepo isolation, pass baseui when cloning a new subrepo (issue2904)

Create the repo with baseui because it should only get the global configuration.

After this patch issue2904 is finally fixed.

(please test the fix)