Merge lp:~jelmer/bzr-loom/register-lazy into lp:bzr-loom

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: 159
Merged at revision: 159
Proposed branch: lp:~jelmer/bzr-loom/register-lazy
Merge into: lp:bzr-loom
Diff against target: 29 lines (+13/-6)
1 file modified
__init__.py (+13/-6)
To merge this branch: bzr merge lp:~jelmer/bzr-loom/register-lazy
Reviewer Review Type Date Requested Status
Loom Developers Pending
Review via email: mp+99934@code.launchpad.net

Description of the change

Use lazy registries if supported (introduced in bzr 2.6)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '__init__.py'
--- __init__.py 2012-03-16 17:15:22 +0000
+++ __init__.py 2012-03-29 13:17:29 +0000
@@ -115,12 +115,19 @@
115install_lazy_named_hook('bzrlib.status', 'hooks', 'post_status',115install_lazy_named_hook('bzrlib.status', 'hooks', 'post_status',
116 show_loom_summary, 'loom status')116 show_loom_summary, 'loom status')
117117
118from bzrlib.revisionspec import revspec_registry118try:
119revspec_registry.register_lazy('thread:', 'bzrlib.plugins.loom.revspec',119 from bzrlib.registry import register_lazy
120 'RevisionSpecThread')120except ImportError: # bzr < 2.6
121revspec_registry.register_lazy('below:', 'bzrlib.plugins.loom.revspec',121 from bzrlib.revisionspec import revspec_registry
122 'RevisionSpecBelow')122 revspec_registry.register_lazy('thread:', 'bzrlib.plugins.loom.revspec',
123123 'RevisionSpecThread')
124 revspec_registry.register_lazy('below:', 'bzrlib.plugins.loom.revspec',
125 'RevisionSpecBelow')
126else:
127 register_lazy("bzrlib.revisionspec", "revspec_registry", 'thread:',
128 'bzrlib.plugins.loom.revspec', 'RevisionSpecThread')
129 register_lazy("bzrlib.revisionspec", "revspec_registry", 'below:',
130 'bzrlib.plugins.loom.revspec', 'RevisionSpecBelow')
124131
125_LOOM_FORMATS = {132_LOOM_FORMATS = {
126 "Bazaar-NG Loom branch format 1\n": "BzrBranchLoomFormat1",133 "Bazaar-NG Loom branch format 1\n": "BzrBranchLoomFormat1",

Subscribers

People subscribed via source and target branches