Hg server replication

Dustin Sallings dustin at spy.net
Tue Nov 6 20:03:27 CST 2007


On Nov 6, 2007, at 16:10 , Wing Choi wrote:

> I am looking at some kind of way to let me replicate an
> Hg server so that pushes from a downstream client get
> replicated automagically for 2+ upstream servers.
> Ideally, this must be able to take on possible collisions from
> 2+ downstream clients pushing conflicting changesets.
>
> are there some sort of precommit hooks that can achieve this?


	It can be done, but you're probably asking for more than you think  
you are.

	Do you want to allow multiple heads to be created?  I'd assume not,  
so you'd need to force a merge after a commit (you really want to  
allow people to commit before breaking their trees).

	By having more than one upstream, you'd really need to get a merge  
that would make all of these servers happy, but there's no two phase  
commit.  Each user ends being responsible for making sure that each  
upstream contains a singly-headed view of everything each user has seen.

	You also have to consider what happens if one of these upstreams is  
unavailable (which is really a desirable state since decentralization  
means we can work under suboptimal conditions).

-- 
Dustin Sallings




More information about the Mercurial mailing list