Merge lp:~mwhudson/launchpad/bug-444387 into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/bug-444387
Merge into: lp:launchpad
Diff against target: 61 lines
2 files modified
lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt (+28/-1)
lib/lp/registry/templates/productseries-codesummary.pt (+2/-2)
To merge this branch: bzr merge lp:~mwhudson/launchpad/bug-444387
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+12949@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi,

This is a one character fix for the linked bug (an obvious mistake in the template) and a somewhat ugly test.

Cheers,
mwh

Revision history for this message
Paul Hummer (rockstar) :
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/stories/productseries/xx-productseries-link-branch.txt'
2--- lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 2009-09-18 15:24:30 +0000
3+++ lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 2009-10-06 22:05:27 +0000
4@@ -23,6 +23,25 @@
5
6 The only field shown is the branch field.
7
8+ # Add 15 revisions to the branch we're going to link; 10 old ones
9+ # and 5 within the last 30 days.
10+ >>> import datetime
11+ >>> import pytz
12+ >>> from zope.component import getUtility
13+ >>> from lp.code.interfaces.branch import IBranchSet
14+ >>> from lp.testing import time_counter
15+ >>> login('admin@canonical.com')
16+ >>> branch = getUtility(IBranchSet).getByUniqueName('~name12/firefox/main')
17+ >>> now = datetime.datetime.now(pytz.UTC)
18+ >>> day_delta = datetime.timedelta(days=1)
19+ >>> factory.makeRevisionsForBranch(
20+ ... branch, count=10, date_generator=time_counter(
21+ ... now - datetime.timedelta(days=50), day_delta))
22+ >>> factory.makeRevisionsForBranch(
23+ ... branch, count=5, date_generator=time_counter(
24+ ... now - datetime.timedelta(days=10), day_delta))
25+ >>> logout()
26+
27 >>> print sample_browser.title
28 Link an existing branch to...
29 >>> sample_browser.getControl('Branch').value = '~name12/firefox/main'
30@@ -34,7 +53,15 @@
31 Series trunk : Mozilla Firefox
32 >>> branch = find_tag_by_id(sample_browser.contents, 'branch-details')
33 >>> print extract_text(branch)
34- lp://dev/firefox - Sample Person ...
35+ lp://dev/firefox - Sample Person
36+ Change branch
37+
38+The total and recent revision counts for the branch are displayed to
39+give an idea of overall and recent activity on the project.
40+
41+ >>> revisions = find_tag_by_id(sample_browser.contents, 'branch-revision-details')
42+ >>> print extract_text(revisions)
43+ 15 revisions, 5 in the past month.
44
45 A helpful informational message is also shown to the user.
46
47
48=== modified file 'lib/lp/registry/templates/productseries-codesummary.pt'
49--- lib/lp/registry/templates/productseries-codesummary.pt 2009-09-05 06:40:36 +0000
50+++ lib/lp/registry/templates/productseries-codesummary.pt 2009-10-06 22:05:27 +0000
51@@ -88,9 +88,9 @@
52 <a
53 tal:replace="structure context/menu:overview/link_branch/fmt:icon" />
54 </div>
55- <div tal:condition="context/branch/revision_count">
56+ <div id="branch-revision-details" tal:condition="context/branch/revision_count">
57 <span tal:replace="context/branch/revision_count">35</span> revisions,
58- <span talreplace="context/branch/@@+product-summary-listing/recent_revision_count">31</span> in the past month.
59+ <span tal:replace="context/branch/@@+product-summary-listing/recent_revision_count">31</span> in the past month.
60 </div>
61 </tal:block>
62