changeset 31244:636f55b9ba23

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 02 Mar 2017 13:31:32 +0100
parents 816bc3b35bac
children c1ebe18d5156
files hgext/shelve.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)]