changeset 18948:2f05fa162316

localrepo: use "vfs.rename()" instead of "util.rename()"
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 15 Apr 2013 01:22:15 +0900
parents 9b82f93e3a7a
children 138978f20180
files mercurial/localrepo.py mercurial/scmutil.py
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Apr 15 01:22:15 2013 +0900
+++ b/mercurial/localrepo.py	Mon Apr 15 01:22:15 2013 +0900
@@ -904,17 +904,15 @@
         self.destroying()
         transaction.rollback(self.sopener, self.sjoin('undo'), ui.warn)
         if self.vfs.exists('undo.bookmarks'):
-            util.rename(self.join('undo.bookmarks'),
-                        self.join('bookmarks'))
+            self.vfs.rename('undo.bookmarks', 'bookmarks')
         if self.svfs.exists('undo.phaseroots'):
-            util.rename(self.sjoin('undo.phaseroots'),
-                        self.sjoin('phaseroots'))
+            self.svfs.rename('undo.phaseroots', 'phaseroots')
         self.invalidate()
 
         parentgone = (parents[0] not in self.changelog.nodemap or
                       parents[1] not in self.changelog.nodemap)
         if parentgone:
-            util.rename(self.join('undo.dirstate'), self.join('dirstate'))
+            self.vfs.rename('undo.dirstate', 'dirstate')
             try:
                 branch = self.opener.read('undo.branch')
                 self.dirstate.setbranch(encoding.tolocal(branch))
--- a/mercurial/scmutil.py	Mon Apr 15 01:22:15 2013 +0900
+++ b/mercurial/scmutil.py	Mon Apr 15 01:22:15 2013 +0900
@@ -254,6 +254,9 @@
     def readdir(self, path=None, stat=None, skip=None):
         return osutil.listdir(self.join(path), stat, skip)
 
+    def rename(self, src, dst):
+        return util.rename(self.join(src), self.join(dst))
+
     def stat(self, path=None):
         return os.stat(self.join(path))