vfs: use 'vfs' module directly in 'hgext.shelve'
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Thu, 02 Mar 2017 13:31:32 +0100
changeset 31244 636f55b9ba23
parent 31243 816bc3b35bac
child 31245 c1ebe18d5156
vfs: use 'vfs' module directly in 'hgext.shelve' Now that the 'vfs' classes moved in their own module, lets use the new module directly. We update code iteratively to help with possible bisect needs in the future.
hgext/shelve.py
--- a/hgext/shelve.py	Thu Mar 02 13:31:23 2017 +0100
+++ b/hgext/shelve.py	Thu Mar 02 13:31:32 2017 +0100
@@ -46,6 +46,7 @@
     scmutil,
     templatefilters,
     util,
+    vfs as vfsmod,
 )
 
 from . import (
@@ -78,8 +79,8 @@
     def __init__(self, repo, name, filetype=None):
         self.repo = repo
         self.name = name
-        self.vfs = scmutil.vfs(repo.join(shelvedir))
-        self.backupvfs = scmutil.vfs(repo.join(backupdir))
+        self.vfs = vfsmod.vfs(repo.join(shelvedir))
+        self.backupvfs = vfsmod.vfs(repo.join(backupdir))
         self.ui = self.repo.ui
         if filetype:
             self.fname = name + '.' + filetype
@@ -220,7 +221,7 @@
         util.unlinkpath(repo.join(cls._filename), ignoremissing=True)
 
 def cleanupoldbackups(repo):
-    vfs = scmutil.vfs(repo.join(backupdir))
+    vfs = vfsmod.vfs(repo.join(backupdir))
     maxbackups = repo.ui.configint('shelve', 'maxbackups', 10)
     hgfiles = [f for f in vfs.listdir()
                if f.endswith('.' + patchextension)]