[PATCH 5 of 5] localrepo: deprecated 'repo.opener' (API)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Mar 1 21:58:45 EST 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1470398170 -7200
#      Fri Aug 05 13:56:10 2016 +0200
# Node ID aacf8b01b81483b4815a974f17d0ff5d214c4d3d
# Parent  437a39859c33901ea29cd22341d93be752e4acc0
# EXP-Topic vfs.cleanup
localrepo: deprecated 'repo.opener' (API)

The "new" 'repo.vfs' attribute have been around for almost 5 years. I think we
can deprecate the old form now ;-)

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -266,7 +266,6 @@ class localrepository(object):
         self.nofsauditor = pathutil.pathauditor(self.root, self._checknested,
                                                 realfs=False)
         self.vfs = scmutil.vfs(self.path)
-        self.opener = self.vfs
         self.baseui = baseui
         self.ui = baseui.copy()
         self.ui.copy = baseui.copy # prevent copying repo configuration
@@ -379,6 +378,11 @@ class localrepository(object):
         self.ui.deprecwarn("use 'repo.wvfs' instead of 'repo.wopener'", '4.2')
         return self.wvfs
 
+    @property
+    def opener(self):
+        self.ui.deprecwarn("use 'repo.vfs' instead of 'repo.opener'", '4.2')
+        return self.vfs
+
     def close(self):
         self._writecaches()
 
diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -123,7 +123,6 @@ class statichttprepository(localrepo.loc
 
         vfsclass = build_opener(ui, authinfo)
         self.vfs = vfsclass(self.path)
-        self.opener = self.vfs
         self._phasedefaults = []
 
         self.names = namespaces.namespaces()


More information about the Mercurial-devel mailing list