Rev 4263: Include the msgeditor hooks in known_hooks. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Apr 7 11:41:34 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4263
revision-id: pqm at pqm.ubuntu.com-20090407104130-ka3rxokxvi9yfbck
parent: pqm at pqm.ubuntu.com-20090407081119-1sok81r9ekyriw0y
parent: james.westby at canonical.com-20090406223135-f7os74eyxlbpxtal
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-04-07 11:41:30 +0100
message:
  Include the msgeditor hooks in known_hooks.
modified:
  bzrlib/hooks.py                hooks.py-20070325015548-ix4np2q0kd8452au-1
  bzrlib/tests/test_hooks.py     test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
    ------------------------------------------------------------
    revno: 4230.1.2
    revision-id: james.westby at canonical.com-20090406223135-f7os74eyxlbpxtal
    parent: james.westby at canonical.com-20090402222850-gmc5y4mq1usjf4x5
    committer: James Westby <james.westby at canonical.com>
    branch nick: bzr.dev
    timestamp: Mon 2009-04-06 23:31:35 +0100
    message:
      Update the comments based on those in the test.
    modified:
      bzrlib/hooks.py                hooks.py-20070325015548-ix4np2q0kd8452au-1
      bzrlib/tests/test_hooks.py     test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
    ------------------------------------------------------------
    revno: 4230.1.1
    revision-id: james.westby at canonical.com-20090402222850-gmc5y4mq1usjf4x5
    parent: pqm at pqm.ubuntu.com-20090401111640-wnn3068uv1nc8lhj
    committer: James Westby <james.westby at canonical.com>
    branch nick: bzr.dev
    timestamp: Thu 2009-04-02 23:28:50 +0100
    message:
      Add msgeditor hooks to known_hooks.
      
      This means that the testsuite prevents any registered hooks from triggering
      during the testsuite.
      
      It also adds comment to try and give the meaning of the parameters.
    modified:
      bzrlib/hooks.py                hooks.py-20070325015548-ix4np2q0kd8452au-1
=== modified file 'bzrlib/hooks.py'
--- a/bzrlib/hooks.py	2009-04-06 02:31:52 +0000
+++ b/bzrlib/hooks.py	2009-04-07 10:41:30 +0000
@@ -31,6 +31,10 @@
 
 
 known_hooks = registry.Registry()
+# known_hooks registry contains
+# tuple of (module, member name) which is the hook point
+# module where the specific hooks are defined
+# callable to get the empty specific Hooks for that attribute
 known_hooks.register_lazy(('bzrlib.branch', 'Branch.hooks'), 'bzrlib.branch',
     'BranchHooks')
 known_hooks.register_lazy(('bzrlib.bzrdir', 'BzrDir.hooks'), 'bzrlib.bzrdir',
@@ -39,6 +43,8 @@
     'bzrlib.commands', 'CommandHooks')
 known_hooks.register_lazy(('bzrlib.lock', 'Lock.hooks'), 'bzrlib.lock',
     'LockHooks')
+known_hooks.register_lazy(('bzrlib.msgeditor', 'hooks'), 'bzrlib.msgeditor',
+    'MessageEditorHooks')
 known_hooks.register_lazy(('bzrlib.mutabletree', 'MutableTree.hooks'),
     'bzrlib.mutabletree', 'MutableTreeHooks')
 known_hooks.register_lazy(('bzrlib.smart.client', '_SmartClient.hooks'),

=== modified file 'bzrlib/tests/test_hooks.py'
--- a/bzrlib/tests/test_hooks.py	2009-03-24 01:53:42 +0000
+++ b/bzrlib/tests/test_hooks.py	2009-04-06 22:31:35 +0000
@@ -162,7 +162,7 @@
     def test_items_are_reasonable_keys(self):
         # All the items in the known_hooks registry need to map from
         # (module_name, member_name) tuples to the callable used to get an
-        # empty Hooks of for that attribute. This is used to support the test
+        # empty Hooks for that attribute. This is used to support the test
         # suite which needs to generate empty hooks (and HookPoints) to ensure
         # isolation and prevent tests failing spuriously.
         for key, factory in known_hooks.items():




More information about the bazaar-commits mailing list