mercurial/changelog.py
changeset 19898 3f92e749d381
parent 18587 cbf5f3eb9d13
child 19899 8c3dcbbfb5de
--- a/mercurial/changelog.py	Tue Oct 15 00:51:04 2013 +0900
+++ b/mercurial/changelog.py	Tue Oct 15 00:51:04 2013 +0900
@@ -224,10 +224,10 @@
         self.opener = self._realopener
         # move redirected index data back into place
         if self._divert:
-            nfile = self.opener(self.indexfile + ".a")
-            n = nfile.name
+            tmpname = self.indexfile + ".a"
+            nfile = self.opener.open(tmpname)
             nfile.close()
-            util.rename(n, n[:-2])
+            self.opener.rename(tmpname, self.indexfile)
         elif self._delaybuf:
             fp = self.opener(self.indexfile, 'a')
             fp.write("".join(self._delaybuf))