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

Laurens Holst laurens.nospam at grauw.nl
Mon Sep 28 17:20:30 CDT 2009


# HG changeset patch
# User Grauw <laurens.hg at grauw.nl>
# Date 1254174954 -7200
# Node ID c6d8d8a535d478f6fdc00dd6e111c34cf7491c2b
# Parent  844c64c7cc2123c5ae16fbfcd27f16fa3e232eca
Reorder rename operations to minimise risk of leaving repository in unknown state
because of interfering virus scanner. As suggested by Steve Borho, see
http://bitbucket.org/tortoisehg/stable/issue/580/#comment-57703
Issue 1840 - AVG anti-virus interferes with disk access

diff -r 844c64c7cc21 -r c6d8d8a535d4 mercurial/util.py
--- a/mercurial/util.py	Fri Aug 07 01:15:16 2009 +0200
+++ b/mercurial/util.py	Mon Sep 28 23:55:54 2009 +0200
@@ -444,8 +444,8 @@
 
         temp = tempname(dst)
         os.rename(dst, temp)
+        os.rename(src, dst)
         os.unlink(temp)
-        os.rename(src, dst)
 
 def unlink(f):
     """unlink and remove the directory if it is empty"""


More information about the Mercurial-devel mailing list