Patchwork [4,of,4] filecache: make 'join' abstract

login
register
mail settings
Submitter Pierre-Yves David
Date March 9, 2017, 1:09 a.m.
Message ID <4bbb1523d63a06b9b137.1489021787@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19047/
State Accepted
Headers show

Comments

Pierre-Yves David - March 9, 2017, 1:09 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1470399893 -7200
#      Fri Aug 05 14:24:53 2016 +0200
# Node ID 4bbb1523d63a06b9b137a1c9bbf643fdc885cdda
# Parent  d2b18fdb4de965ee6481b73de99bd0c73704f760
# 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 4bbb1523d63a
filecache: make 'join' abstract

All subclass redevines this method, so we can turn it abstract.
Augie Fackler - March 10, 2017, 1:31 a.m.
On Wed, Mar 08, 2017 at 05:09:47PM -0800, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1470399893 -7200
> #      Fri Aug 05 14:24:53 2016 +0200
> # Node ID 4bbb1523d63a06b9b137a1c9bbf643fdc885cdda
> # Parent  d2b18fdb4de965ee6481b73de99bd0c73704f760
> # 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 4bbb1523d63a
> filecache: make 'join' abstract

Queued these, thanks.

>
> All subclass redevines this method, so we can turn it abstract.

                 ^ your spell checker integration may be broken? (fixed in flight, but wanted to let you know in case it has broken on you)

>
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -881,7 +881,7 @@ class filecache(object):
>          function to call the appropriate join function on 'obj' (an instance
>          of the class that its member function was decorated).
>          """
> -        return obj.join(fname)
> +        raise NotImplementedError
>
>      def __call__(self, func):
>          self.func = func
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -881,7 +881,7 @@  class filecache(object):
         function to call the appropriate join function on 'obj' (an instance
         of the class that its member function was decorated).
         """
-        return obj.join(fname)
+        raise NotImplementedError
 
     def __call__(self, func):
         self.func = func