diff mercurial/util.py @ 9530:ba8a86d86fd6

Merge with -crew-stable
author Matt Mackall <mpm@selenic.com>
date Wed, 07 Oct 2009 23:25:41 -0500
parents effa05849027 e61e7b3e46d0
children f0417b6ff98a
line wrap: on
line diff
--- a/mercurial/util.py	Sat Oct 03 15:57:48 2009 -0500
+++ b/mercurial/util.py	Wed Oct 07 23:25:41 2009 -0500
@@ -444,7 +444,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):