close file before renaming it (since it doesn't work the other way on windows)
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 14 Nov 2005 21:47:07 +0100
changeset 1546 487e256ad545
parent 1545 d69070c2547a
child 1547 4dea10839201
close file before renaming it (since it doesn't work the other way on windows)
mercurial/util.py
--- a/mercurial/util.py	Mon Nov 14 16:10:59 2005 +0100
+++ b/mercurial/util.py	Mon Nov 14 21:47:07 2005 +0100
@@ -388,8 +388,8 @@
             file.__init__(self, self.temp, mode)
         def close(self):
             if not self.closed:
+                file.close(self)
                 rename(self.temp, self.__name)
-            file.close(self)
         def __del__(self):
             self.close()