Dealing with broken connections

Guido Ostkamp hg at
Fri Mar 14 14:46:56 CDT 2008

On Fri, 14 Mar 2008, Benoit Boissinot wrote:

> On Fri, Mar 14, 2008 at 10:50 AM, Guido Ostkamp <hg at> wrote:
>> Hello,
>>  I would like to know how stable Mercurial is when it comes
>>  deal with broken connections.
>>  When I do a clone of a very large remote repository and
>>  the connection breaks in between and I have to kill
>>  the Mercurial process which got stuck, what happens?
> It removes the repository.
>>  Am I left with a broken repository?
> It doesn't leave anything.
>>  Can I somehow resume the cloning, for example by using
>>  'hg pull' instead of 'hg clone' to retrieve the rest of it?
> No, but what you can do for unreliable connections is to provide a 
> bundle (the full history in one file) that you can get via rsync or 
> http.

well, the problem is that this doesn't happen inhouse where a bundle would 
certainly be an option but out in the wild (internet) where connection 
breaks are rather common.

Looking at generic large repositories like OpenSolaris I am the one who 
does the cloning and I don't think I can get them to provide the stuff as 

Would it for some technical reason be impossible to resume a cloning 
process or is it just not yet implemented at the moment?

I thought I've read something here earlier that Mercurial only adds to 
files containing repository internal data but never overwrites something 
in order to be on the safe side in case of a crash.

At a first glance, this looks to me as if a resume should be possible.

>>  What, if I have worked on a repo, then tried to update it
>>  using 'pull' from upstream to fetch the latest changes,
>>  and this pull fails in between due to broken connection?
> The repo will rollback and you'll get the same state as before the pull.

Ok, at least it will not break.



More information about the Mercurial mailing list