changeset 9544:b6b0c42739e9

Merge with crew-stable
author Steve Borho <steve@borho.org>
date Tue, 06 Oct 2009 16:08:38 -0500
parents 56a5f80556f5 (current diff) e61e7b3e46d0 (diff)
children 98feea5659d9
files mercurial/util.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Mon Oct 05 22:57:15 2009 +0200
+++ b/mercurial/util.py	Tue Oct 06 16:08:38 2009 -0500
@@ -427,7 +427,14 @@
 
         temp = tempname(dst)
         os.rename(dst, temp)
-        os.unlink(temp)
+        try:
+            os.unlink(temp)
+        except:
+            # Some rude AV-scanners on Windows may cause the unlink to
+            # fail. Not aborting here just leaks the temp file, whereas
+            # aborting at this point may leave serious inconsistencies.
+            # Ideally, we would notify the user here.
+            pass
         os.rename(src, dst)
 
 def unlink(f):