Merge lp:~mbp/udd/819910-service-root into lp:udd

Proposed by Martin Pool
Status: Merged
Approved by: John A Meinel
Approved revision: 505
Merged at revision: 505
Proposed branch: lp:~mbp/udd/819910-service-root
Merge into: lp:udd
Diff against target: 19 lines (+4/-4)
1 file modified
import_package.py (+4/-4)
To merge this branch: bzr merge lp:~mbp/udd/819910-service-root
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+71832@code.launchpad.net

Description of the change

Use the root url expected by the Launchpad session object, to avoid httperrors.

I haven't yet put this through a whole run, but it does let me manually run the code from inside file_mp etc.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

very similar to code I put into hydrazine. Looks fine to me.

lp:~mbp/udd/819910-service-root updated
505. By Martin Pool

Use lp's branches.getByUrl rather than url hacking (thanks jam)

Revision history for this message
John A Meinel (jameinel) wrote :

I don't think this applies anymore:
# Strip off the scheme, and hostname.

And the syntax is ugly (having to lp_call(lp.branches.getByUrl the lp api seems a bit redundant)

However, it all looks correct and better than before.

review: Approve
lp:~mbp/udd/819910-service-root updated
506. By Martin Pool

Remove dead comment

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'import_package.py'
2--- import_package.py 2011-07-12 22:55:49 +0000
3+++ import_package.py 2011-08-17 10:23:30 +0000
4@@ -499,11 +499,11 @@
5
6
7 def file_mp(distro, release, pocket, name, bstore, lp_side_branch_path):
8- lp_url = lpapi.SERVICE_ROOT \
9- + lp_side_branch_path[lp_side_branch_path.index("~"):]
10- lp_branch = lpapi.lp_call(lp.load, lp_url)
11+ lp_branch = lpapi.lp_call(lp.branches.getByUrl,
12+ url=lp_side_branch_path)
13 target_branch_url = bstore._branch_url(distro, release, pocket)
14- target_lp_branch = lpapi.lp_call(lp.load, target_branch_url)
15+ target_lp_branch = lpapi.lp_call(lp.branches.getByUrl,
16+ url=target_branch_url)
17 # It would be great to notify the uploader and pusher of the merge
18 # proposal, but let's start with ~ubuntu-dev.
19 ubuntu_dev = lpapi.lp_call(operator.getitem, lp.people, 'ubuntu-dev')

Subscribers

People subscribed via source and target branches