Patchwork [4,of,9] changelog: use "vfs.rename()" instead of "util.rename()"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Oct. 14, 2013, 4:16 p.m.
Message ID <2be31b7a1e81f9b6ce8f.1381767364@juju>
Download mbox | patch
Permalink /patch/2762/
State Accepted
Commit 3f92e749d381575a5313963919b924b8bc64a178
Headers show

Comments

Katsunori FUJIWARA - Oct. 14, 2013, 4:16 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1381765864 -32400
#      Tue Oct 15 00:51:04 2013 +0900
# Node ID 2be31b7a1e81f9b6ce8f20c1fd221e1eea3117a7
# Parent  2e396a54482df124d5d4cb58be2398a143edefe7
changelog: use "vfs.rename()" instead of "util.rename()"

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -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))