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.
--- 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']))