Patchwork [2,of,5] localrepo: deprecated 'repo.wopener' (API)

login
register
mail settings
Submitter Pierre-Yves David
Date March 2, 2017, 2:58 a.m.
Message ID <66df771e26f3e26aa200.1488423522@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18864/
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 1470398025 -7200
#      Fri Aug 05 13:53:45 2016 +0200
# Node ID 66df771e26f3e26aa2000b150427852fb8c88bf3
# Parent  b34202587b00d949dd77ff97399e50d6340779a6
# EXP-Topic vfs.cleanup
localrepo: deprecated 'repo.wopener' (API)

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

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -259,7 +259,6 @@  class localrepository(object):
         self.vfs = None
         # vfs to access the store part of the repository
         self.svfs = None
-        self.wopener = self.wvfs
         self.root = self.wvfs.base
         self.path = self.wvfs.join(".hg")
         self.origroot = path
@@ -375,6 +374,11 @@  class localrepository(object):
         # generic mapping between names and nodes
         self.names = namespaces.namespaces()
 
+    @property
+    def wopener(self):
+        self.ui.deprecwarn("use 'repo.wvfs' instead of 'repo.wopener'", '4.2')
+        return self.wvfs
+
     def close(self):
         self._writecaches()