Patchwork [3,of,3] repoview: backout ced3ecfc2e57

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 17, 2014, 8:42 p.m.
Message ID <a109b5f941b26f80d189.1418848938@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/7149/
State Accepted
Headers show

Comments

Pierre-Yves David - Dec. 17, 2014, 8:42 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1418847667 28800
#      Wed Dec 17 12:21:07 2014 -0800
# Node ID a109b5f941b26f80d1895c2a9010adf5ca3fc082
# Parent  9ce12a1f60bd91ffba2270b347485c18795cceb0
repoview: backout ced3ecfc2e57

Monkey patching repoview does not really works and making it really work will
be really hard. So we better have it broken without complexity than broken with
extra complexity.
Augie Fackler - Dec. 22, 2014, 9:44 p.m.
On Wed, Dec 17, 2014 at 12:42:18PM -0800, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1418847667 28800
> #      Wed Dec 17 12:21:07 2014 -0800
> # Node ID a109b5f941b26f80d1895c2a9010adf5ca3fc082
> # Parent  9ce12a1f60bd91ffba2270b347485c18795cceb0
> repoview: backout ced3ecfc2e57

Sigh. Queued. Monkeypatching in-tree should probably be something we
work to eradicate.

(I'll do copyediting inflight since this looks like it won't be painful.)

>
> Monkey patching repoview does not really works and making it really work will
> be really hard. So we better have it broken without complexity than broken with
> extra complexity.
>
> diff --git a/mercurial/repoview.py b/mercurial/repoview.py
> --- a/mercurial/repoview.py
> +++ b/mercurial/repoview.py
> @@ -4,11 +4,10 @@
>  #                Logilab SA        <contact@logilab.fr>
>  #
>  # This software may be used and distributed according to the terms of the
>  # GNU General Public License version 2 or any later version.
>
> -import types
>  import copy
>  import error
>  import phases
>  import util
>  import obsolete
> @@ -309,14 +308,10 @@ class repoview(object):
>      # everything access are forwarded to the proxied repo
>      def __getattr__(self, attr):
>          return getattr(self._unfilteredrepo, attr)
>
>      def __setattr__(self, attr, value):
> -        # Allow method replacement on filtered repos, like status() in
> -        # largefiles' purge override
> -        if type(value) == types.FunctionType:
> -            object.__setattr__(self, attr, value)
>          return setattr(self._unfilteredrepo, attr, value)
>
>      def __delattr__(self, attr):
>          return delattr(self._unfilteredrepo, attr)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -4,11 +4,10 @@ 
 #                Logilab SA        <contact@logilab.fr>
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import types
 import copy
 import error
 import phases
 import util
 import obsolete
@@ -309,14 +308,10 @@  class repoview(object):
     # everything access are forwarded to the proxied repo
     def __getattr__(self, attr):
         return getattr(self._unfilteredrepo, attr)
 
     def __setattr__(self, attr, value):
-        # Allow method replacement on filtered repos, like status() in
-        # largefiles' purge override
-        if type(value) == types.FunctionType:
-            object.__setattr__(self, attr, value)
         return setattr(self._unfilteredrepo, attr, value)
 
     def __delattr__(self, attr):
         return delattr(self._unfilteredrepo, attr)