Layered repositories

Radoslaw Szkodzinski astralstorm at
Sun Sep 18 07:50:08 CDT 2005

On Sun, 18 Sep 2005 12:43:09 +0200
Erich Schubert <erich at> wrote:


> If it helps you understanding my question:
> Does mercurial allow me to check out multiple repositorys into one
> output directory and is still able to run update and commit nicely?
> (i.e. update/commit files from/to whichever repostory they were from)

Ahh.. so that's the problem. 
You can have them checked out.

I think you can't pull just one of them yet, you need a whole history.

My method for checking out multiple branches w/o merging them:
hg update -C -b <branch for edition>
hg revert -r <one head>
hg revert -r <another head>
hg revert -r <head of branch for edition>

This will keep all heads checked out.
The files from other branches will have status "?".
You don't need to run it all the time, only when switching the branch for edition. You can even have different branches checked out in different directories for convenience.

This method will work if the branches do not overwrite each other's
files. If that happens, the contents and existence of the files will
depend on the head last reverted to.

I'd suggest adding an option -b to hg revert too. It will make life a
bit easier. Right now you can use local tags to track the ends of the

hg heads shows you all active heads of branches.
The head last reverted to can be detected using hg identify.

GPG Key id:  0xD1F10BA2
Fingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the Mercurial mailing list