← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/git-root-view into lp:launchpad.

Commit message:
Add a count of Git repositories to the root view.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/git-root-view/+merge/257709

Add a count of Git repositories to the root view.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/git-root-view into lp:launchpad.
=== 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 @@
 from lp.blueprints.interfaces.specification import ISpecificationSet
 from lp.bugs.interfaces.bug import IBugSet
 from lp.code.interfaces.branchcollection import IAllBranches
+from lp.code.interfaces.gitcollection import IAllGitRepositories
 from lp.registry.browser.announcement import HasAnnouncementsView
 from lp.registry.interfaces.person import IPersonSet
 from lp.registry.interfaces.pillar import IPillarNameSet
@@ -114,6 +115,11 @@
         return getUtility(IAllBranches).visibleByUser(None).count()
 
     @property
+    def gitrepository_count(self):
+        """The total Git repository count in all of Launchpad."""
+        return getUtility(IAllGitRepositories).visibleByUser(None).count()
+
+    @property
     def bug_count(self):
         """The total bug count in all of Launchpad."""
         return getUtility(ILaunchpadStatisticSet).value('bug_count')

=== 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 @@
     >>> view.featured_projects = featured_projects
     >>> view.featured_projects_top = featured_projects_top
 
-The view provides the counts of branches, bugs, translations, blueprints,
-and answers registered in Launchpad.
+The view provides the counts of branches, Git repositories, bugs,
+projects, translations, blueprints, and answers registered in Launchpad.
 
     >>> view.branch_count
     30
+    >>> view.gitrepository_count
+    0
     >>> view.bug_count
     12
     >>> view.project_count

=== 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 @@
               <strong
                 tal:content="view/branch_count/fmt:intcomma">123</strong>&nbsp;branches,
               <strong
+                tal:content="view/gitrepository_count/fmt:intcomma">123</strong>&nbsp;Git repositories,
+              <strong
                 tal:content="view/translation_count/fmt:intcomma">123</strong>&nbsp;translations,
               <strong
                 tal:content="view/answer_count/fmt:intcomma">123</strong>&nbsp;answers,


Follow ups