Patchwork [4,of,5] statichttp: use 'repo.vfs' as the main attribute

login
register
mail settings
Submitter Pierre-Yves David
Date March 2, 2017, 2:58 a.m.
Message ID <437a39859c33901ea29c.1488423524@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18866/
State Accepted
Headers show

Comments

Pierre-Yves David - March 2, 2017, 2:58 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1488421498 -3600
#      Thu Mar 02 03:24:58 2017 +0100
# Node ID 437a39859c33901ea29cd22341d93be752e4acc0
# Parent  dc2ae1022304ad29959c52e1f549bb05472e9f43
# EXP-Topic vfs.cleanup
statichttp: use 'repo.vfs' as the main attribute

We are about to deprecate the repo.opener attribute, we prepare the static http
code to be ready for this change.

Patch

diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -121,9 +121,9 @@  class statichttprepository(localrepo.loc
         u = util.url(path.rstrip('/') + "/.hg")
         self.path, authinfo = u.authinfo()
 
-        opener = build_opener(ui, authinfo)
-        self.opener = opener(self.path)
-        self.vfs = self.opener
+        vfsclass = build_opener(ui, authinfo)
+        self.vfs = vfsclass(self.path)
+        self.opener = self.vfs
         self._phasedefaults = []
 
         self.names = namespaces.namespaces()
@@ -148,7 +148,7 @@  class statichttprepository(localrepo.loc
                 raise error.RepoError(msg)
 
         # setup store
-        self.store = store.store(requirements, self.path, opener)
+        self.store = store.store(requirements, self.path, vfsclass)
         self.spath = self.store.path
         self.svfs = self.store.opener
         self.sjoin = self.store.join