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.
This commit is contained in:
Pierre-Yves David 2012-11-26 19:11:13 +01:00
parent 8d8e5b22ad
commit edc0b7dbec

View File

@ -23,6 +23,12 @@ class storecache(filecache):
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']))