fsmonitor: remove use of repo.opener
authorDurham Goode <durham@fb.com>
Tue, 07 Mar 2017 12:52:00 -0800
changeset 31215 15c998528c36
parent 31214 167b69ccc62c
child 31216 21fa3d3688f3
fsmonitor: remove use of repo.opener This has been deprecated, so we need to switch to the appropriate vfs apis.
hgext/fsmonitor/state.py
--- a/hgext/fsmonitor/state.py	Tue Feb 28 15:19:08 2017 +0100
+++ b/hgext/fsmonitor/state.py	Tue Mar 07 12:52:00 2017 -0800
@@ -20,7 +20,7 @@
 
 class state(object):
     def __init__(self, repo):
-        self._opener = repo.opener
+        self._vfs = repo.vfs
         self._ui = repo.ui
         self._rootdir = pathutil.normasprefix(repo.root)
         self._lastclock = None
@@ -33,7 +33,7 @@
 
     def get(self):
         try:
-            file = self._opener('fsmonitor.state', 'rb')
+            file = self._vfs('fsmonitor.state', 'rb')
         except IOError as inst:
             if inst.errno != errno.ENOENT:
                 raise
@@ -91,7 +91,7 @@
             return
 
         try:
-            file = self._opener('fsmonitor.state', 'wb', atomictemp=True)
+            file = self._vfs('fsmonitor.state', 'wb', atomictemp=True)
         except (IOError, OSError):
             self._ui.warn(_("warning: unable to write out fsmonitor state\n"))
             return