comparison mercurial/localrepo.py @ 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
comparison
equal deleted inserted replaced
17993:1a6f8820eb71 17994:8899bf48116a
20 20
21 class storecache(filecache): 21 class storecache(filecache):
22 """filecache for files in the store""" 22 """filecache for files in the store"""
23 def join(self, obj, fname): 23 def join(self, obj, fname):
24 return obj.sjoin(fname) 24 return obj.sjoin(fname)
25
26 def unfilteredmeth(orig):
27 """decorate method that always need to be run on unfiltered version"""
28 def wrapper(repo, *args, **kwargs):
29 return orig(repo.unfiltered(), *args, **kwargs)
30 return wrapper
25 31
26 MODERNCAPS = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle')) 32 MODERNCAPS = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle'))
27 LEGACYCAPS = MODERNCAPS.union(set(['changegroupsubset'])) 33 LEGACYCAPS = MODERNCAPS.union(set(['changegroupsubset']))
28 34
29 class localpeer(peer.peerrepository): 35 class localpeer(peer.peerrepository):