changeset 17994:8899bf48116a

clfilter: introduce an `unfilteredmethod` decorator This decorator ensure the method in run on an unfiltered version of the repository. See follow-up commit for details. This decorator is not named `unfiltered` because it would clash with the `unfilteredmethod` on `localrepo` itself.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 26 Nov 2012 19:11:13 +0100
parents 1a6f8820eb71
children a5d85476da6e
files mercurial/localrepo.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Nov 21 00:36:29 2012 +0100
+++ b/mercurial/localrepo.py	Mon Nov 26 19:11:13 2012 +0100
@@ -23,6 +23,12 @@
     def join(self, obj, fname):
         return obj.sjoin(fname)
 
+def unfilteredmeth(orig):
+    """decorate method that always need to be run on unfiltered version"""
+    def wrapper(repo, *args, **kwargs):
+        return orig(repo.unfiltered(), *args, **kwargs)
+    return wrapper
+
 MODERNCAPS = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle'))
 LEGACYCAPS = MODERNCAPS.union(set(['changegroupsubset']))