Merge lp:~abentley/launchpad/real-branch-name into lp:launchpad

Proposed by Aaron Bentley on 2012-06-19
Status: Merged
Approved by: Aaron Bentley on 2012-06-19
Approved revision: no longer in the source branch.
Merged at revision: 15460
Proposed branch: lp:~abentley/launchpad/real-branch-name
Merge into: lp:launchpad
Diff against target: 115 lines (+24/-5)
7 files modified
.bzrignore (+1/-0)
lib/lp/code/stories/branches/xx-private-branch-listings.txt (+2/-2)
lib/lp/registry/browser/productseries.py (+5/-0)
lib/lp/registry/browser/tests/test_productseries_views.py (+13/-0)
lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.txt (+1/-1)
lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt (+1/-1)
lib/lp/registry/templates/productseries-codesummary.pt (+1/-1)
To merge this branch: bzr merge lp:~abentley/launchpad/real-branch-name
Reviewer Review Type Date Requested Status
Richard Harding (community) 2012-06-19 Approve on 2012-06-19
Review via email: mp+111082@code.launchpad.net

Commit Message

Product series page includes useful branch name.

Description of the Change

= Summary =
Fix bug #760775: project series page linked branch information is useless

== Proposed fix ==
Provide a URL of the form lp:~person/product/branch.

== Pre-implementation notes ==
None

== LOC Rationale ==
I have a LOC credit of 1951

== Implementation details ==
Provide a long_bzr_identity method on the view. This does not need to be a more general method because this data is very rarely displayed.

Also ignored a directory that "make" creates.

== Tests ==
bin/test -vv browser.tests.test_productseries -t est_meaningful_branch_na

== Demo and Q/A ==
Go to any productseries page. The URL shown should look like a uniquename, not like lp:product/productseries.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  .bzrignore
  lib/lp/registry/browser/productseries.py
  lib/lp/registry/browser/tests/test_productseries_views.py
  lib/lp/registry/templates/productseries-codesummary.pt

To post a comment you must log in.
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 '.bzrignore'
2--- .bzrignore 2012-06-14 13:41:58 +0000
3+++ .bzrignore 2012-06-20 17:29:27 +0000
4@@ -78,3 +78,4 @@
5 scripts/mlist-sync.py
6 ./celerybeat-schedule
7 !logs/README.txt
8+./logs
9
10=== modified file 'lib/lp/code/stories/branches/xx-private-branch-listings.txt'
11--- lib/lp/code/stories/branches/xx-private-branch-listings.txt 2012-06-01 02:26:43 +0000
12+++ lib/lp/code/stories/branches/xx-private-branch-listings.txt 2012-06-20 17:29:27 +0000
13@@ -255,14 +255,14 @@
14
15 >>> print extract_text(
16 ... find_tag_by_id(admin_browser.contents, 'branch-details'))
17- lp://dev/landscape - Landscape Developers ...
18+ lp://dev/... - Landscape Developers ...
19
20 Landscape developers can see it.
21
22 >>> landscape_dev_browser.open('http://launchpad.dev/landscape/trunk')
23 >>> print extract_text(find_tag_by_id(
24 ... landscape_dev_browser.contents, 'branch-details'))
25- lp://dev/landscape - Landscape Developers ...
26+ lp://dev/... - Landscape Developers ...
27
28 But normal people can't.
29
30
31=== modified file 'lib/lp/registry/browser/productseries.py'
32--- lib/lp/registry/browser/productseries.py 2012-03-07 19:29:06 +0000
33+++ lib/lp/registry/browser/productseries.py 2012-06-20 17:29:27 +0000
34@@ -466,6 +466,11 @@
35 check_permission('launchpad.View', branch))
36
37 @property
38+ def long_bzr_identity(self):
39+ """The bzr identity of the branch including the unique_name."""
40+ return self.context.branch.branchIdentities()[-1][0]
41+
42+ @property
43 def is_obsolete(self):
44 """Return True if the series is OBSOLETE.
45
46
47=== modified file 'lib/lp/registry/browser/tests/test_productseries_views.py'
48--- lib/lp/registry/browser/tests/test_productseries_views.py 2012-04-11 14:40:02 +0000
49+++ lib/lp/registry/browser/tests/test_productseries_views.py 2012-06-20 17:29:27 +0000
50@@ -5,6 +5,9 @@
51
52 __metaclass__ = type
53
54+
55+import soupmatchers
56+
57 from lp.bugs.interfaces.bugtask import (
58 BugTaskStatus,
59 BugTaskStatusSearch,
60@@ -45,6 +48,16 @@
61 productseries = self.factory.makeProductSeries()
62 self.getViewBrowser(productseries, view_name='+timeline-graph')
63
64+ def test_meaningful_branch_name(self):
65+ """The displayed branch name should include the unique name."""
66+ branch = self.factory.makeProductBranch()
67+ series = self.factory.makeProductSeries(branch=branch)
68+ tag = soupmatchers.Tag('series-branch', 'a',
69+ attrs={'id': 'series-branch'},
70+ text='lp://dev/' + branch.unique_name)
71+ browser = self.getViewBrowser(series)
72+ self.assertThat(browser.contents, soupmatchers.HTMLContains(tag))
73+
74
75 class TestProductSeriesStatus(TestCaseWithFactory):
76 """Tests for ProductSeries:+status."""
77
78=== modified file 'lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.txt'
79--- lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.txt 2012-02-22 21:42:44 +0000
80+++ lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.txt 2012-06-20 17:29:27 +0000
81@@ -46,7 +46,7 @@
82 >>> print extract_text(find_tag_by_id(browser.contents, 'description'))
83 Product series add testing
84
85- >>> browser.getLink('lp://dev/firefox/stable')
86+ >>> browser.getLink('lp://dev/~mark/firefox/release-0.9.2')
87 <Link ... url='http://code.launchpad.dev/~mark/firefox/release-0.9.2'>
88
89
90
91=== modified file 'lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt'
92--- lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 2011-12-08 19:18:27 +0000
93+++ lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 2012-06-20 17:29:27 +0000
94@@ -62,7 +62,7 @@
95 Series trunk : Mozilla Firefox
96 >>> branch = find_tag_by_id(sample_browser.contents, 'branch-details')
97 >>> print extract_text(branch)
98- lp://dev/firefox - Sample Person
99+ lp://dev/~name12/firefox/main - Sample Person
100 Change branch
101
102 >>> print sample_browser.getLink('Browse the code').url
103
104=== modified file 'lib/lp/registry/templates/productseries-codesummary.pt'
105--- lib/lp/registry/templates/productseries-codesummary.pt 2012-03-11 04:19:20 +0000
106+++ lib/lp/registry/templates/productseries-codesummary.pt 2012-06-20 17:29:27 +0000
107@@ -70,7 +70,7 @@
108 <div id="branch-details">
109 <a id="series-branch" class="sprite branch"
110 tal:attributes="href context/branch/fmt:url"
111- tal:content="context/branch/bzr_identity">Mozilla Thunderbird 0.9.1</a>
112+ tal:content="view/long_bzr_identity">Mozilla Thunderbird 0.9.1</a>
113 - <a tal:replace="structure context/branch/owner/fmt:link:code/+ownedbranches" />
114 <a
115 tal:replace="structure context/menu:overview/link_branch/fmt:icon" />