Rev 5799: Add counters for the old config hooks. in file:///home/vila/src/bzr/experimental/config/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Jun 13 11:02:43 UTC 2011
At file:///home/vila/src/bzr/experimental/config/
------------------------------------------------------------
revno: 5799
revision-id: v.ladeuil+lp at free.fr-20110613110243-6mr3fi1kmyrw5bzz
parent: v.ladeuil+lp at free.fr-20110613105754-ue5y3tm2soyuso4f
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: selftest-config-stats
timestamp: Mon 2011-06-13 13:02:43 +0200
message:
Add counters for the old config hooks.
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2011-06-13 10:44:12 +0000
+++ b/bzrlib/tests/__init__.py 2011-06-13 11:02:43 +0000
@@ -1034,12 +1034,14 @@
def create_counter(name): self._counters[name] = 0
def increment_counter(name): self._counters[name] += 1
- for hook_name in ('get', 'set', 'remove', 'load', 'save',):
+ for hook_name in (
+ 'get', 'set', 'remove', 'load', 'save',
+ 'old_get', 'old_set', 'old_remove', 'old_load', 'old_save',):
counter_name = 'config.%s' % (hook_name,)
create_counter(counter_name)
def create_hook_point(name):
- # Force the lambda creation so we refer to the right counter
- # name
+ # Force the lambda creation at the right time so we refer to
+ # the right counter name
return lambda *args: increment_counter(name)
config.ConfigHooks.install_named_hook(
hook_name, create_hook_point(counter_name),
More information about the bazaar-commits
mailing list