Merge lp:~wallyworld/launchpad/getBranches-dsp-579602 into lp:launchpad

Proposed by Ian Booth
Status: Merged
Approved by: Ian Booth
Approved revision: no longer in the source branch.
Merged at revision: 16026
Proposed branch: lp:~wallyworld/launchpad/getBranches-dsp-579602
Merge into: lp:launchpad
Diff against target: 35 lines (+14/-0)
2 files modified
lib/lp/registry/configure.zcml (+1/-0)
lib/lp/registry/doc/distribution-sourcepackage.txt (+13/-0)
To merge this branch: bzr merge lp:~wallyworld/launchpad/getBranches-dsp-579602
Reviewer Review Type Date Requested Status
Richard Harding (community) Approve
Review via email: mp+126149@code.launchpad.net

Commit message

Add missing permission to allow getBranches() on DSP.

Description of the change

Add getBranches to the <allow> in the ZCML <class> declaration for DistributionSourcePackage

Update the distribution-sourcepackage.txt doctest to add a call to getBranches() to make sure it works. Without the fix, the call raises a 401.

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/configure.zcml'
2--- lib/lp/registry/configure.zcml 2012-08-21 04:04:47 +0000
3+++ lib/lp/registry/configure.zcml 2012-09-25 04:39:23 +0000
4@@ -501,6 +501,7 @@
5 drivers
6 findRelatedArchivePublications
7 findRelatedArchives
8+ getBranches
9 getMergeProposals
10 getReleasesAndPublishingHistory
11 getUsedBugTagsWithOpenCounts
12
13=== modified file 'lib/lp/registry/doc/distribution-sourcepackage.txt'
14--- lib/lp/registry/doc/distribution-sourcepackage.txt 2012-01-20 15:42:44 +0000
15+++ lib/lp/registry/doc/distribution-sourcepackage.txt 2012-09-25 04:39:23 +0000
16@@ -163,6 +163,19 @@
17 >>> dsp3.currentrelease.version
18 u'cr.g7-37'
19
20+=== Distribution Source Package Branches ===
21+
22+We can use the getBranches() API from IHasBranches to get the related branches
23+for a DSP.
24+
25+ >>> fred = factory.makePerson(name='fred')
26+ >>> branch = factory.makePackageBranch(
27+ ... distroseries=hoary, sourcepackagename='pmount', name='tip',
28+ ... owner=fred)
29+ >>> [branch] = list(dsp.getBranches())
30+ >>> print branch.unique_name
31+ ~fred/ubuntu/hoary/pmount/tip
32+
33 === Grabbing DSPRs ===
34
35 To list the current 'pmount in Ubuntu' ISourcePackages, use