Merge lp:~sinzui/launchpad/change_branch-info-type into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | j.c.sackett on 2012-08-16 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 15820 |
| Proposed branch: | lp:~sinzui/launchpad/change_branch-info-type |
| Merge into: | lp:launchpad |
| Diff against target: |
60 lines (+28/-0) 2 files modified
lib/lp/code/interfaces/branch.py (+7/-0) lib/lp/code/model/tests/test_branch.py (+21/-0) |
| To merge this branch: | bzr merge lp:~sinzui/launchpad/change_branch-info-type |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| j.c.sackett (community) | 2012-08-16 | Approve on 2012-08-16 | |
|
Review via email:
|
|||
Commit Message
Export IBranch.
Description of the Change
It is not possible to change branch information types over the API to
match permitted types in the project's branch_
not possible to for projects to migrate their branches to match
the policy.
-------
RULES
Pre-
* Export IBranch.
established by IBug.transition
QA
* Visit https:/
* Verify the private branches say they are Private.
* Run this example script
* Verify the private branches are now Proprietary.
{{{
#!/usr/bin/python
from optparse import OptionParser
import logging
import sys
from launchpadlib.
SCRIPT_NAME = 'migrate-
logging.
log = logging.
log.setLevel(
class LpProjectMigrat
"""Migrate a ~launchpad project to use sharing."""
def __init__(self, lp, service, project, trusted_teams):
self.lp = lp
def migrate(self):
def change_
log.info(
log.info(
def share_with_
permissions = {
for team in self.trusted_teams:
def change_
statuses = [
for branch in self.project.
if branch.
def get_trusted_
log.
return [
]
def get_pmteam_
log.
return [lp.projects[
def get_option_
"""Return the option parser for this program."""
usage = "usage: %%prog [options] \n"
parser = OptionParser(
parser.
"-e", "--environment", dest="env",
help="The environment to use")
parser.
env='https:/
test=True)
return parser
def main(argv):
parser = get_option_parser()
(options, args_) = parser.
lp = Launchpad.
service = lp.load(
trusted_teams = get_trusted_
for project in get_pmteam_
migrator = LpProjectMigrat
if __name__ == '__main__':
sys.
}}}
LINT
lib/
lib/
TEST
./bin/test -vvc -t TestWebservice lp.code.
IMPLEMENTATION
Exported the interface to only require the information type kwarg.
lib/
lib/

This looks good. Thanks, Curtis.