[PATCH 2 of 2] Reorder rename operations to minimise risk of leaving repository in unknown state

Sune Foldager cryo at cyanite.org
Sat Oct 3 06:35:45 CDT 2009


Laurens Holst wrote:
> I think the core problem here is that in Windows, there is simply not 
> a concept of an atomic rename to an existing file.

Indeed. It works like this: You can never rename a file into an existing 
file in any way. Also, you CAN delete an open file (if opened with 
correct share modes), but it will not disappear from the directory list 
until it is closed. Finally, you CAN rename an open file (if opened with 
correct share modes), and the rename WILL take place immediately, 
fortunately. This is why the code looks as it does right now.

/Sune



More information about the Mercurial-devel mailing list