Patchwork [10,of,22] vfs: use 'vfs' module directly in 'mercurial.bundlerepo'

login
register
mail settings
Submitter Pierre-Yves David
Date March 8, 2017, 9:18 p.m.
Message ID <ce0764554a608df329eb.1489007901@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19008/
State Accepted
Headers show

Comments

Pierre-Yves David - March 8, 2017, 9:18 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1488462423 -3600
#      Thu Mar 02 14:47:03 2017 +0100
# Node ID ce0764554a608df329eb80533bb9479c22b6ae39
# Parent  8946a52d22e991e168df21399f5786969551b55f
# EXP-Topic vfs.cleanup
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r ce0764554a60
vfs: use 'vfs' module directly in 'mercurial.bundlerepo'

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.

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -37,8 +37,8 @@  from . import (
     phases,
     pycompat,
     revlog,
-    scmutil,
     util,
+    vfs as vfsmod,
 )
 
 class bundlerevlog(revlog.revlog):
@@ -50,7 +50,7 @@  class bundlerevlog(revlog.revlog):
         #
         # To differentiate a rev in the bundle from a rev in the revlog, we
         # check revision against repotiprev.
-        opener = scmutil.readonlyvfs(opener)
+        opener = vfsmod.readonlyvfs(opener)
         revlog.revlog.__init__(self, opener, indexfile)
         self.bundle = bundle
         n = len(self)
@@ -239,7 +239,7 @@  class bundlephasecache(phases.phasecache
     def __init__(self, *args, **kwargs):
         super(bundlephasecache, self).__init__(*args, **kwargs)
         if util.safehasattr(self, 'opener'):
-            self.opener = scmutil.readonlyvfs(self.opener)
+            self.opener = vfsmod.readonlyvfs(self.opener)
 
     def write(self):
         raise NotImplementedError