Layered repositories

Erich Schubert erich at
Thu Sep 22 18:36:59 CDT 2005

Hello Eric,
I didn't expect mercurial to be able to do this directly, since this is
indeed rather special. Btw I think that CVS could do it, since it
operates on a per-file basis, it then probably is just a matter of

> Your branch structure would be something like:
>           /--mail server-->
> -----base------->
>           \--DNS server-->

yeah, except that I also ahve branches which should be derived from
_two_ lower branches. E.g. I do have a feature branch for hotplug. I
don't know yet which machines do need hotplug and which don't, but that
should be only a matter of adding/removing one line in their layer

> You would then merge changes from your base to your mail server whenever
> you made a change.  Files that you made no changes to in the mail server

More often the other way round. I would do changes *on* the server, then
merge them back into a certain layer (usually the one the file was last
modified in)
and then would need to merge them back into the branches forked off from
that base.

> It probably be nearly a complete solution to your problem if there was a
> merge option that said "Ignore changes made to files I changed on the
> branch."  In fact, I expect that it would be possible to convince hg's

This would indeed solve part of the problem.
But the other part is feeding back changes into the appropriate layers.

> Another option would be to have a single repository with all the
> different configurations in their own subdirectories and a little shell
> script that automatically pulled them all together.  You'd have to have
> a special entry for an ignored file though.

Yes, that is also rather close to what my current prototype does. Except
it's a python script, and emulating svn:ignore to ignore files.
But it also copies back changed files, so I can easily see the
differences. I don't have a scripted commit yet, but I can commit from
my subdirs.

best regards,
Erich Schubert
   erich@(|    --    GPG Key ID: 4B3A135C    (o_
                Friends are those who reach out for                 //\
                  your hand but touch your heart.                   V_/_
              Denken ist oft schwerer, als man denkt.

More information about the Mercurial mailing list