Merge lp:~nigelbabu/launchpad/645825-ui-example into lp:launchpad

Proposed by Nigel Babu
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 13073
Proposed branch: lp:~nigelbabu/launchpad/645825-ui-example
Merge into: lp:launchpad
Diff against target: 61 lines (+33/-2)
3 files modified
lib/lp/registry/browser/tests/test_productseries_views.py (+31/-0)
lib/lp/registry/templates/productseries-codesummary.pt (+1/-1)
lib/lp/registry/templates/productseries-linkbranch.pt (+1/-1)
To merge this branch: bzr merge lp:~nigelbabu/launchpad/645825-ui-example
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Graham Binns (community) code Approve
Review via email: mp+61175@code.launchpad.net

Commit message

[r=gmb,stevenk] [r=gmb][bug=645825] The ProductSeries:+code-summary page now uses the ProductSeries.name when providing branch URLs rather than just relying on the default series name for the product.

Description of the change

The pages that show, or let me choose, the branch for a productseries tell me I can create the branch with "bzr push." They give a full example command line with the right product name, but the productseries name always seems to be "trunk" rather than the name of the series I'm actually trying to set a branch for. Fixed the hardcoded trunk with name of the series.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) wrote :

This change looks great, but I don't think it's ready to land -- I'd like to see some test changes or test additions first.

review: Needs Fixing
Revision history for this message
Graham Binns (gmb) wrote :

Blood, sweat, tears and tests. As I mentioned on IRC, the test needs a leading comment explaining the expected behaviour. Other than that, this is good to go.

review: Approve (code)
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)
Revision history for this message
Graham Binns (gmb) wrote :

There were some test failures in this branch when I ran it through
EC2, but they came shortly after the devel build had failed. I'll
check to make sure that the failures weren't a result of whatever
caused the build failure.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'lib/lp/registry/browser/tests/test_productseries_views.py'
--- lib/lp/registry/browser/tests/test_productseries_views.py 1970-01-01 00:00:00 +0000
+++ lib/lp/registry/browser/tests/test_productseries_views.py 2011-05-18 04:15:51 +0000
@@ -0,0 +1,31 @@
1# Copyright 2011 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""View tests for ProductSeries pages."""
5
6__metaclass__ = type
7
8from canonical.testing.layers import DatabaseFunctionalLayer
9from lp.testing import (
10 TestCaseWithFactory,
11 person_logged_in
12 )
13from lp.testing.views import create_initialized_view
14from lp.testing.matchers import Contains
15
16
17class TestProductSeriesHelp(TestCaseWithFactory):
18 layer = DatabaseFunctionalLayer
19
20 def test_new_series_help(self):
21 # The LP branch URL displayed to the user on the +code-summary page for
22 # a product series will relate to that series instead of to the default
23 # series for the Product.
24 product = self.factory.makeProduct()
25 series = self.factory.makeProductSeries(product=product)
26 person = product.owner
27 ssh_key = self.factory.makeSSHKey(person=person)
28 branch_url = "lp:~%s/%s/%s" % (person.name, product.name, series.name)
29 with person_logged_in(person):
30 view = create_initialized_view(series, '+code-summary')
31 self.assertThat(view(), Contains(branch_url))
032
=== modified file 'lib/lp/registry/templates/productseries-codesummary.pt'
--- lib/lp/registry/templates/productseries-codesummary.pt 2011-01-17 21:03:16 +0000
+++ lib/lp/registry/templates/productseries-codesummary.pt 2011-05-18 04:15:51 +0000
@@ -41,7 +41,7 @@
41 <li id="ssh-key-directions">41 <li id="ssh-key-directions">
42 Push the branch directly to Launchpad, e.g. with:<br />42 Push the branch directly to Launchpad, e.g. with:<br />
43 <tt><strong>43 <tt><strong>
44 bzr push lp:~<tal:user replace="view/user/name"/>/<tal:project replace="context/product/name"/>/trunk44 bzr push lp:~<tal:user replace="view/user/name"/>/<tal:products replace="context/product/name"/>/<tal:series replace="context/name"/>
45 </strong></tt>45 </strong></tt>
46 <tal:no-keys condition="not:view/user/sshkeys">46 <tal:no-keys condition="not:view/user/sshkeys">
47 <br/>To authenticate with the Launchpad branch upload service,47 <br/>To authenticate with the Launchpad branch upload service,
4848
=== modified file 'lib/lp/registry/templates/productseries-linkbranch.pt'
--- lib/lp/registry/templates/productseries-linkbranch.pt 2011-01-17 20:39:15 +0000
+++ lib/lp/registry/templates/productseries-linkbranch.pt 2011-05-18 04:15:51 +0000
@@ -28,7 +28,7 @@
28 <li id="ssh-key-directions">28 <li id="ssh-key-directions">
29 Push the branch directly to Launchpad, e.g. with:<br />29 Push the branch directly to Launchpad, e.g. with:<br />
30 <tt><strong>30 <tt><strong>
31 bzr push lp:~<tal:user replace="view/user/name"/>/<tal:project replace="context/product/name"/>/trunk31 bzr push lp:~<tal:user replace="view/user/name"/>/<tal:project replace="context/product/name"/>/<tal:series replace="context/name"/>
32 </strong></tt>32 </strong></tt>
33 <tal:no-keys condition="not:view/user/sshkeys">33 <tal:no-keys condition="not:view/user/sshkeys">
34 <br/>To authenticate with the Launchpad branch upload service,34 <br/>To authenticate with the Launchpad branch upload service,