Working with subrepos in Mercurial
I've got a big system with many components that I want to spread out over several different mercurial repositories (so people working on parts of the system don't have to checkout the entire system). It needs to work on both UNIX and Windows.
Within the system, I have one directory that needs to be shared in many places (holds common stuff like CSS files, and images).
I've set it up, so that each of the components has a subrepo to the shared repo, and that repo is also checked out at a higher level. I've done this because I want programmers to be able to do a 'hg pull' from the main repository, but not an 'hg push' (any cha开发者_StackOverflownges get pulled by an 'hg serve' from their work and checked first before going back into the main repository).
So at the top level, a programmer can check out:
Core Style ComponentSetA ComponentSetB etc.
These all point back to http://machine/hg/RepoName (via clone).
And I have subrepos at:
ComponentSetA/web/style (with style = ../../Style in web/.hgsub) ComponentSetB/web/style etc.
My problem is that on an 'hg clone', I can't seem to get the subrepos to create themselves automatically. I'd like them to be transparent. If any of the programmers aren't making changes, they shouldn't notice that they are there...
It's OK if I have to check out the Style repo first, and then do one of the components, but I'd like the extra level of indirection to the top-level repo to allow programmers to push their lower-level changes into a common repo.
Any suggestions?
Correct me if I'm wrong, but it sounds like you have a .hgsub
file in a web
subdirectory and not in the root of the repo. If you want web/style
to be a subrepo, you add it to your root .hgsub
like this:
web/style = ../../Style
精彩评论