filemerge: better handling of failing remove of temporary files
authorMads Kiilerich <madski@unity3d.com>
Thu, 17 Apr 2014 14:54:46 +0200
changeset 21100 098a274764b3
parent 21099 12c7cea6235c
child 21101 64911a12dc28
filemerge: better handling of failing remove of temporary files We have seen some failures on Windows that could seem like the unlinks of temporary files were failing. That could perhaps be because the merge tool somehow still held the files open. Instead of the bare bone os.unlink, use our util.unlink with special rename/retry handling on Windows.
mercurial/filemerge.py
--- a/mercurial/filemerge.py	Thu Apr 17 14:54:46 2014 +0200
+++ b/mercurial/filemerge.py	Thu Apr 17 14:54:46 2014 +0200
@@ -334,10 +334,10 @@
             if onfailure:
                 ui.warn(onfailure % fd)
         else:
-            os.unlink(back)
+            util.unlink(back)
 
-        os.unlink(b)
-        os.unlink(c)
+        util.unlink(b)
+        util.unlink(c)
         return r
 
     if not r and (_toolbool(ui, tool, "checkconflicts") or
@@ -368,10 +368,10 @@
         if onfailure:
             ui.warn(onfailure % fd)
     else:
-        os.unlink(back)
+        util.unlink(back)
 
-    os.unlink(b)
-    os.unlink(c)
+    util.unlink(b)
+    util.unlink(c)
     return r
 
 # tell hggettext to extract docstrings from these functions: