1
# Copyright (C) 2006 by Canonical Ltd
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
"""Launchpad.net branch registration plugin for bzr
19
This adds commands that tell launchpad about newly-created branches, etc.
21
To install this file, put the 'bzr_lp' directory, or a symlink to it,
22
in your ~/.bazaar/plugins/ directory.
25
# see http://bazaar-vcs.org/Specs/BranchRegistrationTool
27
from bzrlib.commands import Command, Option, register_command
31
class cmd_register_branch(Command):
32
"""Register a branch with launchpad.net.
34
This command lists a bzr branch in the directory of branches on
35
launchpad.net. Registration allows the bug to be associated with
36
bugs or specifications.
38
Before using this command you must register the project to which the
39
branch belongs, and create an account for yourself on launchpad.net.
42
branch_url: The publicly visible url for the branch.
43
This must be an http or https url, not a local file
47
bzr register-branch http://foo.com/bzr/fooproject.mine \
50
takes_args = ['branch_url']
52
def run(self, branch_url):
53
from lp_registration import register_interactive
54
register_interactive(branch_url)
56
register_command(cmd_register_branch)
59
"""Called by bzrlib to fetch tests for this plugin"""
60
from unittest import TestSuite, TestLoader
62
return TestLoader().loadTestsFromModule(test_register)