~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/__init__.py

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 by Canonical Ltd
 
1
# Copyright (C) 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
"""Launchpad.net branch registration plugin for bzr
18
 
 
19
 
This adds commands that tell launchpad about newly-created branches, etc.
 
17
"""Launchpad.net integration plugin for Bazaar
20
18
 
21
19
To install this file, put the 'bzr_lp' directory, or a symlink to it,
22
20
in your ~/.bazaar/plugins/ directory.
28
26
# see http://bazaar-vcs.org/Specs/BranchRegistrationTool
29
27
 
30
28
from bzrlib.commands import Command, Option, register_command
31
 
 
 
29
from bzrlib.transport import register_lazy_transport
 
30
from bzrlib.help_topics import topic_registry
32
31
 
33
32
 
34
33
class cmd_register_branch(Command):
35
34
    """Register a branch with launchpad.net.
36
35
 
37
36
    This command lists a bzr branch in the directory of branches on
38
 
    launchpad.net.  Registration allows the bug to be associated with
 
37
    launchpad.net.  Registration allows the branch to be associated with
39
38
    bugs or specifications.
40
39
    
41
40
    Before using this command you must register the product to which the
115
114
 
116
115
register_command(cmd_register_branch)
117
116
 
 
117
register_lazy_transport(
 
118
    'lp:',
 
119
    'bzrlib.plugins.launchpad.lp_indirect',
 
120
    'launchpad_transport_indirect')
 
121
 
 
122
register_lazy_transport(
 
123
    'lp://',
 
124
    'bzrlib.plugins.launchpad.lp_indirect',
 
125
    'launchpad_transport_indirect')
 
126
 
118
127
def test_suite():
119
128
    """Called by bzrlib to fetch tests for this plugin"""
120
129
    from unittest import TestSuite, TestLoader
121
130
    import test_register
122
 
    return TestLoader().loadTestsFromModule(test_register)
 
131
    import test_lp_indirect
 
132
 
 
133
    loader = TestLoader()
 
134
    suite = TestSuite()
 
135
    for m in [test_register, test_lp_indirect]:
 
136
        suite.addTests(loader.loadTestsFromModule(m))
 
137
    return suite
 
138
 
 
139
_launchpad_help = """Integration with Launchpad.net
 
140
 
 
141
Launchpad.net provides free Bazaar branch hosting with integrated bug and
 
142
specification tracking.
 
143
 
 
144
The bzr client (through the plugin called 'launchpad') has two special
 
145
features to communicate with Launchpad:
 
146
 
 
147
    * The register-branch command tells launchpad about the url of a 
 
148
      public branch.  Launchpad will then mirror the branch, display
 
149
      its contents and allow it to be attached to bugs and other 
 
150
      objects.
 
151
 
 
152
    * The 'lp:' transport uses Launchpad as a directory service: 
 
153
      for example 'lp:bzr' and 'lp:python' refer to the main branches of the
 
154
      relevant projects and may be branched, logged, etc.  (Only read access
 
155
      is supported at present.)
 
156
 
 
157
For more information see http://help.launchpad.net/
 
158
"""
 
159
topic_registry.register('launchpad',
 
160
    _launchpad_help,
 
161
    'Using Bazaar with Launchpad.net')