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
=== modified file 'lib/lp/app/browser/root.py'
--- lib/lp/app/browser/root.py 2015-01-16 12:51:28 +0000
+++ lib/lp/app/browser/root.py 2015-04-29 00:39:51 +0000
@@ -34,6 +34,7 @@
34from lp.blueprints.interfaces.specification import ISpecificationSet34from lp.blueprints.interfaces.specification import ISpecificationSet
35from lp.bugs.interfaces.bug import IBugSet35from lp.bugs.interfaces.bug import IBugSet
36from lp.code.interfaces.branchcollection import IAllBranches36from lp.code.interfaces.branchcollection import IAllBranches
37from lp.code.interfaces.gitcollection import IAllGitRepositories
37from lp.registry.browser.announcement import HasAnnouncementsView38from lp.registry.browser.announcement import HasAnnouncementsView
38from lp.registry.interfaces.person import IPersonSet39from lp.registry.interfaces.person import IPersonSet
39from lp.registry.interfaces.pillar import IPillarNameSet40from lp.registry.interfaces.pillar import IPillarNameSet
@@ -114,6 +115,11 @@
114 return getUtility(IAllBranches).visibleByUser(None).count()115 return getUtility(IAllBranches).visibleByUser(None).count()
115116
116 @property117 @property
118 def gitrepository_count(self):
119 """The total Git repository count in all of Launchpad."""
120 return getUtility(IAllGitRepositories).visibleByUser(None).count()
121
122 @property
117 def bug_count(self):123 def bug_count(self):
118 """The total bug count in all of Launchpad."""124 """The total bug count in all of Launchpad."""
119 return getUtility(ILaunchpadStatisticSet).value('bug_count')125 return getUtility(ILaunchpadStatisticSet).value('bug_count')
120126
=== modified file 'lib/lp/app/browser/tests/root-views.txt'
--- lib/lp/app/browser/tests/root-views.txt 2011-12-24 17:49:30 +0000
+++ lib/lp/app/browser/tests/root-views.txt 2015-04-29 00:39:51 +0000
@@ -49,11 +49,13 @@
49 >>> view.featured_projects = featured_projects49 >>> view.featured_projects = featured_projects
50 >>> view.featured_projects_top = featured_projects_top50 >>> view.featured_projects_top = featured_projects_top
5151
52The view provides the counts of branches, bugs, translations, blueprints,52The view provides the counts of branches, Git repositories, bugs,
53and answers registered in Launchpad.53projects, translations, blueprints, and answers registered in Launchpad.
5454
55 >>> view.branch_count55 >>> view.branch_count
56 3056 30
57 >>> view.gitrepository_count
58 0
57 >>> view.bug_count59 >>> view.bug_count
58 1260 12
59 >>> view.project_count61 >>> view.project_count
6062
=== modified file 'lib/lp/app/templates/root-index.pt'
--- lib/lp/app/templates/root-index.pt 2012-08-14 09:02:13 +0000
+++ lib/lp/app/templates/root-index.pt 2015-04-29 00:39:51 +0000
@@ -159,6 +159,8 @@
159 <strong159 <strong
160 tal:content="view/branch_count/fmt:intcomma">123</strong>&nbsp;branches,160 tal:content="view/branch_count/fmt:intcomma">123</strong>&nbsp;branches,
161 <strong161 <strong
162 tal:content="view/gitrepository_count/fmt:intcomma">123</strong>&nbsp;Git repositories,
163 <strong
162 tal:content="view/translation_count/fmt:intcomma">123</strong>&nbsp;translations,164 tal:content="view/translation_count/fmt:intcomma">123</strong>&nbsp;translations,
163 <strong165 <strong
164 tal:content="view/answer_count/fmt:intcomma">123</strong>&nbsp;answers,166 tal:content="view/answer_count/fmt:intcomma">123</strong>&nbsp;answers,