Patchwork localrepo: deprecate 'repo.join' in favor of 'repo.vfs.join'

login
register
mail settings
Submitter Pierre-Yves David
Date March 12, 2017, 8:17 p.m.
Message ID <1e79d966aa2bdc9e13c6.1489349854@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19238/
State Accepted
Headers show

Comments

Pierre-Yves David - March 12, 2017, 8:17 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1470398944 -7200
#      Fri Aug 05 14:09:04 2016 +0200
# Node ID 1e79d966aa2bdc9e13c62b94b0e12cfc469b5eb5
# Parent  8a17c541177f32348e248608b6a9dfd7fefdf517
# 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 1e79d966aa2b
localrepo: deprecate 'repo.join' in favor of 'repo.vfs.join'

localrepo have an insane amount of method. Accessing the feature through the
vfs is not really harder and allow us to schedule that method for removal.
Augie Fackler - March 12, 2017, 9:59 p.m.
On Sun, Mar 12, 2017 at 01:17:34PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1470398944 -7200
> #      Fri Aug 05 14:09:04 2016 +0200
> # Node ID 1e79d966aa2bdc9e13c62b94b0e12cfc469b5eb5
> # Parent  8a17c541177f32348e248608b6a9dfd7fefdf517
> # 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 1e79d966aa2b
> localrepo: deprecate 'repo.join' in favor of 'repo.vfs.join'

Queued, thanks

>
> localrepo have an insane amount of method. Accessing the feature through the
> vfs is not really harder and allow us to schedule that method for removal.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -932,6 +932,7 @@ class localrepository(object):
>          return None
>
>      def join(self, f, *insidef):
> +        self.ui.deprecwarn("use 'repo.vfs.join' instead of 'repo.join'", '4.0')
>          return self.vfs.join(os.path.join(f, *insidef))
>
>      def wjoin(self, f, *insidef):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -932,6 +932,7 @@  class localrepository(object):
         return None
 
     def join(self, f, *insidef):
+        self.ui.deprecwarn("use 'repo.vfs.join' instead of 'repo.join'", '4.0')
         return self.vfs.join(os.path.join(f, *insidef))
 
     def wjoin(self, f, *insidef):