localrepo: use "vfs.exists()" instead of "os.path.exists()"
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Mon, 15 Apr 2013 01:22:15 +0900
changeset 18947 9b82f93e3a7a
parent 18946 3d4f41eaae67
child 18948 2f05fa162316
localrepo: use "vfs.exists()" instead of "os.path.exists()"
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Apr 15 01:22:15 2013 +0900
+++ b/mercurial/localrepo.py	Mon Apr 15 01:22:15 2013 +0900
@@ -806,7 +806,7 @@
             return tr.nest()
 
         # abort here if the journal already exists
-        if os.path.exists(self.sjoin("journal")):
+        if self.svfs.exists("journal"):
             raise error.RepoError(
                 _("abandoned transaction found - run hg recover"))
 
@@ -844,7 +844,7 @@
     def recover(self):
         lock = self.lock()
         try:
-            if os.path.exists(self.sjoin("journal")):
+            if self.svfs.exists("journal"):
                 self.ui.status(_("rolling back interrupted transaction\n"))
                 transaction.rollback(self.sopener, self.sjoin("journal"),
                                      self.ui.warn)
@@ -861,7 +861,7 @@
         try:
             wlock = self.wlock()
             lock = self.lock()
-            if os.path.exists(self.sjoin("undo")):
+            if self.svfs.exists("undo"):
                 return self._rollback(dryrun, force)
             else:
                 self.ui.warn(_("no rollback information available\n"))
@@ -903,10 +903,10 @@
         parents = self.dirstate.parents()
         self.destroying()
         transaction.rollback(self.sopener, self.sjoin('undo'), ui.warn)
-        if os.path.exists(self.join('undo.bookmarks')):
+        if self.vfs.exists('undo.bookmarks'):
             util.rename(self.join('undo.bookmarks'),
                         self.join('bookmarks'))
-        if os.path.exists(self.sjoin('undo.phaseroots')):
+        if self.svfs.exists('undo.phaseroots'):
             util.rename(self.sjoin('undo.phaseroots'),
                         self.sjoin('phaseroots'))
         self.invalidate()