← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Aaron Bentley has proposed merging lp:~abentley/launchpad/real-branch-name into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #760775 in Launchpad itself: "project series page linked branch information is useless"
  https://bugs.launchpad.net/launchpad/+bug/760775

For more details, see:
https://code.launchpad.net/~abentley/launchpad/real-branch-name/+merge/111082

= 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
-- 
https://code.launchpad.net/~abentley/launchpad/real-branch-name/+merge/111082
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~abentley/launchpad/real-branch-name into lp:launchpad.
=== modified file '.bzrignore'
--- .bzrignore	2012-06-14 13:41:58 +0000
+++ .bzrignore	2012-06-19 18:38:23 +0000
@@ -78,3 +78,4 @@
 scripts/mlist-sync.py
 ./celerybeat-schedule
 !logs/README.txt
+./logs

=== modified file 'lib/lp/registry/browser/productseries.py'
--- lib/lp/registry/browser/productseries.py	2012-03-07 19:29:06 +0000
+++ lib/lp/registry/browser/productseries.py	2012-06-19 18:38:23 +0000
@@ -466,6 +466,11 @@
                 check_permission('launchpad.View', branch))
 
     @property
+    def long_bzr_identity(self):
+        """The bzr identity of the branch including the unique_name."""
+        return self.context.branch.branchIdentities()[-1][0]
+
+    @property
     def is_obsolete(self):
         """Return True if the series is OBSOLETE.
 

=== modified file 'lib/lp/registry/browser/tests/test_productseries_views.py'
--- lib/lp/registry/browser/tests/test_productseries_views.py	2012-04-11 14:40:02 +0000
+++ lib/lp/registry/browser/tests/test_productseries_views.py	2012-06-19 18:38:23 +0000
@@ -5,6 +5,9 @@
 
 __metaclass__ = type
 
+
+import soupmatchers
+
 from lp.bugs.interfaces.bugtask import (
     BugTaskStatus,
     BugTaskStatusSearch,
@@ -45,6 +48,16 @@
         productseries = self.factory.makeProductSeries()
         self.getViewBrowser(productseries, view_name='+timeline-graph')
 
+    def test_meaningful_branch_name(self):
+        """The displayed branch name should include the unique name."""
+        branch = self.factory.makeProductBranch()
+        series = self.factory.makeProductSeries(branch=branch)
+        tag = soupmatchers.Tag('series-branch', 'a',
+                               attrs={'id': 'series-branch'},
+                               text='lp://dev/' + branch.unique_name)
+        browser = self.getViewBrowser(series)
+        self.assertThat(browser.contents, soupmatchers.HTMLContains(tag))
+
 
 class TestProductSeriesStatus(TestCaseWithFactory):
     """Tests for ProductSeries:+status."""

=== modified file 'lib/lp/registry/templates/productseries-codesummary.pt'
--- lib/lp/registry/templates/productseries-codesummary.pt	2012-03-11 04:19:20 +0000
+++ lib/lp/registry/templates/productseries-codesummary.pt	2012-06-19 18:38:23 +0000
@@ -70,7 +70,7 @@
   <div id="branch-details">
     <a id="series-branch" class="sprite branch"
       tal:attributes="href context/branch/fmt:url"
-      tal:content="context/branch/bzr_identity">Mozilla Thunderbird 0.9.1</a>
+      tal:content="view/long_bzr_identity">Mozilla Thunderbird 0.9.1</a>
     - <a tal:replace="structure context/branch/owner/fmt:link:code/+ownedbranches" />
     <a
       tal:replace="structure context/menu:overview/link_branch/fmt:icon" />


Follow ups