[PATCH 5 of 5] localrepo: deprecated 'repo.opener' (API)
Ryan McElroy
rm at fb.com
Thu Mar 2 11:23:09 EST 2017
This series looks good to me. I'd suggest changing the past-tense
"deprecated" to the present-tense "deprecate" in the titles in-flight.
On 3/1/17 6:58 PM, Pierre-Yves David wrote:
> # 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()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=Jw8rundaE7TbmqBYd1txIQ&m=pGe4-AWiOAPibuWIRfURjzzHLk5Xnfg7vTq3aCWDwyM&s=W8xRG1nGSGlZascbfPeFdqDPaF3a3XY5lj-hewgtrNw&e=
More information about the Mercurial-devel
mailing list