Rev 4785: (bialix, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Nov 4 10:37:00 GMT 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4785 [merge]
revision-id: pqm at pqm.ubuntu.com-20091104103659-dvlb83d61qohmntd
parent: pqm at pqm.ubuntu.com-20091104094457-9ye9x123oc3su8ea
parent: v.ladeuil+lp at free.fr-20091104095244-q92h08x72odq7mpm
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-11-04 10:36:59 +0000
message:
(bialix,
vila) Hooks daughter classes should always call the base constructor
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/info.py info.py-20050323235939-6bbfe7d9700b0b9b
bzrlib/tests/test_hooks.py test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
bzrlib/version_info_formats/format_rio.py format_rio.py-20060809202444-ike7i9ub03gb432p-2
=== modified file 'NEWS'
--- a/NEWS 2009-11-04 09:44:57 +0000
+++ b/NEWS 2009-11-04 09:52:44 +0000
@@ -21,6 +21,9 @@
Bug Fixes
*********
+* Hooks daughter classes should always call the base constructor.
+ (Alexander Belchenko, Vincent Ladeuil, #389648)
+
* Sanitize commit messages that come in from the '-m' flag. We translate
'\r\n' => '\n' and a plain '\r' => '\n'. The storage layer doesn't
allow those because XML store silently translate it anyway. (The parser
=== modified file 'bzrlib/info.py'
--- a/bzrlib/info.py 2009-05-01 14:29:06 +0000
+++ b/bzrlib/info.py 2009-11-03 09:32:17 +0000
@@ -484,6 +484,7 @@
"""Hooks for the info command."""
def __init__(self):
+ super(InfoHooks, self).__init__()
self.create_hook(_mod_hooks.HookPoint('repository',
"Invoked when displaying the statistics for a repository. "
"repository is called with a statistics dictionary as returned "
=== modified file 'bzrlib/tests/test_hooks.py'
--- a/bzrlib/tests/test_hooks.py 2009-09-01 12:29:54 +0000
+++ b/bzrlib/tests/test_hooks.py 2009-11-03 09:32:17 +0000
@@ -16,7 +16,11 @@
"""Tests for the core Hooks logic."""
-from bzrlib import branch, errors
+from bzrlib import (
+ branch,
+ errors,
+ tests,
+ )
from bzrlib.hooks import (
HookPoint,
Hooks,
@@ -24,14 +28,9 @@
known_hooks_key_to_object,
known_hooks_key_to_parent_and_attribute,
)
-from bzrlib.errors import (
- UnknownHook,
- )
-
-from bzrlib.tests import TestCase
-
-
-class TestHooks(TestCase):
+
+
+class TestHooks(tests.TestCase):
def test_create_hook_first(self):
hooks = Hooks()
@@ -95,7 +94,7 @@
def test_install_named_hook_raises_unknown_hook(self):
hooks = Hooks()
- self.assertRaises(UnknownHook, hooks.install_named_hook, 'silly',
+ self.assertRaises(errors.UnknownHook, hooks.install_named_hook, 'silly',
None, "")
def test_install_named_hook_appends_known_hook(self):
@@ -111,7 +110,7 @@
self.assertEqual("demo", hooks.get_hook_name(None))
-class TestHook(TestCase):
+class TestHook(tests.TestCase):
def test___init__(self):
doc = ("Invoked after changing the tip of a branch object. Called with"
@@ -154,7 +153,7 @@
callback_repr, repr(hook))
-class TestHookRegistry(TestCase):
+class TestHookRegistry(tests.TestCase):
def test_items_are_reasonable_keys(self):
# All the items in the known_hooks registry need to map from
@@ -170,6 +169,7 @@
new_hooks = factory()
self.assertIsInstance(obj, Hooks)
self.assertEqual(type(obj), type(new_hooks))
+ self.assertEqual("No hook name", new_hooks.get_hook_name(None))
def test_known_hooks_key_to_object(self):
self.assertIs(branch.Branch.hooks,
=== modified file 'bzrlib/version_info_formats/format_rio.py'
--- a/bzrlib/version_info_formats/format_rio.py 2009-04-06 02:54:48 +0000
+++ b/bzrlib/version_info_formats/format_rio.py 2009-11-03 09:32:17 +0000
@@ -84,6 +84,7 @@
"""Hooks for rio-formatted version-info output."""
def __init__(self):
+ super(RioVersionInfoBuilderHooks, self).__init__()
self.create_hook(hooks.HookPoint('revision',
"Invoked when adding information about a revision to the"
" RIO stanza that is printed. revision is called with a"
More information about the bazaar-commits
mailing list