--- 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))