tests/test-fncache.t
changeset 39698 f44187605315
parent 39489 f1186c292d03
child 40262 c8f164061212
equal deleted inserted replaced
39697:98ca9078807a 39698:f44187605315
   446 The cache should not loaded when committing changes to existing files, or when unbundling
   446 The cache should not loaded when committing changes to existing files, or when unbundling
   447 changesets that only contain changes to existing files:
   447 changesets that only contain changes to existing files:
   448 
   448 
   449   $ cat > fncacheloadwarn.py << EOF
   449   $ cat > fncacheloadwarn.py << EOF
   450   > from __future__ import absolute_import
   450   > from __future__ import absolute_import
   451   > from mercurial import extensions, store
   451   > from mercurial import extensions, localrepo
   452   > 
   452   > 
   453   > def extsetup(ui):
   453   > def extsetup(ui):
   454   >     def wrapstore(orig, requirements, *args):
   454   >     def wrapstore(orig, requirements, *args):
   455   >         store = orig(requirements, *args)
   455   >         store = orig(requirements, *args)
   456   >         if 'store' in requirements and 'fncache' in requirements:
   456   >         if 'store' in requirements and 'fncache' in requirements:
   457   >             instrumentfncachestore(store, ui)
   457   >             instrumentfncachestore(store, ui)
   458   >         return store
   458   >         return store
   459   >     extensions.wrapfunction(store, 'store', wrapstore)
   459   >     extensions.wrapfunction(localrepo, 'makestore', wrapstore)
   460   > 
   460   > 
   461   > def instrumentfncachestore(fncachestore, ui):
   461   > def instrumentfncachestore(fncachestore, ui):
   462   >     class instrumentedfncache(type(fncachestore.fncache)):
   462   >     class instrumentedfncache(type(fncachestore.fncache)):
   463   >         def _load(self):
   463   >         def _load(self):
   464   >             ui.warn('fncache load triggered!\n')
   464   >             ui.warn('fncache load triggered!\n')