4

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 changes 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?

1 Answer 1

2

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
1
  • Yes, you are right. But I also had a few other problems going on as well. In the end I put .hgsub at the root with each component path included. I pointed it back up and over relatively to a local copy, but the .hg/hgrc's point to the server because of the clone. Thus changes to the subrepos go back to the server by default (instead of the local copy), so I've lost the level of indirection I was seeking. I also had to settle with 1 level of subrepos instead of 2. Apr 8, 2011 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.