Merge lp:~cjwatson/launchpad/git-root-view into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 17465
Proposed branch: lp:~cjwatson/launchpad/git-root-view
Merge into: lp:launchpad
Diff against target: 56 lines (+12/-2)
3 files modified
lib/lp/app/browser/root.py (+6/-0)
lib/lp/app/browser/tests/root-views.txt (+4/-2)
lib/lp/app/templates/root-index.pt (+2/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/git-root-view
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+257709@code.launchpad.net

Commit message

Add a count of Git repositories to the root view.

Description of the change

Add a count of Git repositories to the root view.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

Ew, but it's no worse than the others.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/browser/root.py'
2--- lib/lp/app/browser/root.py 2015-01-16 12:51:28 +0000
3+++ lib/lp/app/browser/root.py 2015-04-29 00:39:51 +0000
4@@ -34,6 +34,7 @@
5 from lp.blueprints.interfaces.specification import ISpecificationSet
6 from lp.bugs.interfaces.bug import IBugSet
7 from lp.code.interfaces.branchcollection import IAllBranches
8+from lp.code.interfaces.gitcollection import IAllGitRepositories
9 from lp.registry.browser.announcement import HasAnnouncementsView
10 from lp.registry.interfaces.person import IPersonSet
11 from lp.registry.interfaces.pillar import IPillarNameSet
12@@ -114,6 +115,11 @@
13 return getUtility(IAllBranches).visibleByUser(None).count()
14
15 @property
16+ def gitrepository_count(self):
17+ """The total Git repository count in all of Launchpad."""
18+ return getUtility(IAllGitRepositories).visibleByUser(None).count()
19+
20+ @property
21 def bug_count(self):
22 """The total bug count in all of Launchpad."""
23 return getUtility(ILaunchpadStatisticSet).value('bug_count')
24
25=== modified file 'lib/lp/app/browser/tests/root-views.txt'
26--- lib/lp/app/browser/tests/root-views.txt 2011-12-24 17:49:30 +0000
27+++ lib/lp/app/browser/tests/root-views.txt 2015-04-29 00:39:51 +0000
28@@ -49,11 +49,13 @@
29 >>> view.featured_projects = featured_projects
30 >>> view.featured_projects_top = featured_projects_top
31
32-The view provides the counts of branches, bugs, translations, blueprints,
33-and answers registered in Launchpad.
34+The view provides the counts of branches, Git repositories, bugs,
35+projects, translations, blueprints, and answers registered in Launchpad.
36
37 >>> view.branch_count
38 30
39+ >>> view.gitrepository_count
40+ 0
41 >>> view.bug_count
42 12
43 >>> view.project_count
44
45=== modified file 'lib/lp/app/templates/root-index.pt'
46--- lib/lp/app/templates/root-index.pt 2012-08-14 09:02:13 +0000
47+++ lib/lp/app/templates/root-index.pt 2015-04-29 00:39:51 +0000
48@@ -159,6 +159,8 @@
49 <strong
50 tal:content="view/branch_count/fmt:intcomma">123</strong>&nbsp;branches,
51 <strong
52+ tal:content="view/gitrepository_count/fmt:intcomma">123</strong>&nbsp;Git repositories,
53+ <strong
54 tal:content="view/translation_count/fmt:intcomma">123</strong>&nbsp;translations,
55 <strong
56 tal:content="view/answer_count/fmt:intcomma">123</strong>&nbsp;answers,