← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/getBranches-dsp-579602 into lp:launchpad.

Commit message:
Add missing permission to allow getBranches() on DSP.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #579602 in Launchpad itself: "cannot call getBranches on a source package using the API"
  https://bugs.launchpad.net/launchpad/+bug/579602

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/getBranches-dsp-579602/+merge/126149

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. 
-- 
https://code.launchpad.net/~wallyworld/launchpad/getBranches-dsp-579602/+merge/126149
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/getBranches-dsp-579602 into lp:launchpad.
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml	2012-08-21 04:04:47 +0000
+++ lib/lp/registry/configure.zcml	2012-09-25 04:39:23 +0000
@@ -501,6 +501,7 @@
                 drivers
                 findRelatedArchivePublications
                 findRelatedArchives
+                getBranches
                 getMergeProposals
                 getReleasesAndPublishingHistory
                 getUsedBugTagsWithOpenCounts

=== modified file 'lib/lp/registry/doc/distribution-sourcepackage.txt'
--- lib/lp/registry/doc/distribution-sourcepackage.txt	2012-01-20 15:42:44 +0000
+++ lib/lp/registry/doc/distribution-sourcepackage.txt	2012-09-25 04:39:23 +0000
@@ -163,6 +163,19 @@
     >>> dsp3.currentrelease.version
     u'cr.g7-37'
 
+=== Distribution Source Package Branches ===
+
+We can use the getBranches() API from IHasBranches to get the related branches
+for a DSP.
+
+    >>> fred = factory.makePerson(name='fred')
+    >>> branch = factory.makePackageBranch(
+    ...     distroseries=hoary, sourcepackagename='pmount', name='tip',
+    ...     owner=fred)
+    >>> [branch] = list(dsp.getBranches())
+    >>> print branch.unique_name
+    ~fred/ubuntu/hoary/pmount/tip
+
 === Grabbing DSPRs ===
 
 To list the current 'pmount in Ubuntu' ISourcePackages, use


Follow ups