diff -r effa05849027 -r ba8a86d86fd6 mercurial/util.py --- 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):