Index: trunk/extensions/CodeReview/backend/RepoStats.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | $fixmes, |
18 | 18 | $new; |
19 | 19 | |
20 | | - public $fixmesPerPath; |
| 20 | + public $fixmesPerPath, $newPerPath; |
21 | 21 | |
22 | 22 | /** |
23 | 23 | * @param CodeRepository $repo |
— | — | @@ -74,15 +74,26 @@ |
75 | 75 | $this->states[$row->cr_status] = $row->revs; |
76 | 76 | } |
77 | 77 | |
| 78 | + $repoName = $this->repo->getName(); |
| 79 | + |
78 | 80 | $this->fixmes = $this->getAuthorStatusCounts( 'fixme' ); |
79 | 81 | $this->new = $this->getAuthorStatusCounts( 'new' ); |
| 82 | + |
80 | 83 | $this->fixmesPerPath = array(); |
81 | 84 | global $wgCodeReviewFixmePerPath; |
82 | | - if ( isset( $wgCodeReviewFixmePerPath[ $this->repo->getName() ] ) ) { |
83 | | - foreach( $wgCodeReviewFixmePerPath[ $this->repo->getName() ] as $path ) { |
| 85 | + if ( isset( $wgCodeReviewFixmePerPath[ $repoName ] ) ) { |
| 86 | + foreach( $wgCodeReviewFixmePerPath[ $repoName ] as $path ) { |
84 | 87 | $this->fixmesPerPath[$path] = $this->getPathFixmes( $path ); |
85 | 88 | } |
86 | 89 | } |
| 90 | + |
| 91 | + $this->newPerPath = array(); |
| 92 | + global $wgCodeRevieNewPerPath; |
| 93 | + if ( isset( $wgCodeRevieNewPerPath[ $repoName ] ) ) { |
| 94 | + foreach( $wgCodeRevieNewPerPath[ $repoName ] as $path ) { |
| 95 | + $this->newPerPath[$path] = $this->getPathNews( $path ); |
| 96 | + } |
| 97 | + } |
87 | 98 | wfProfileOut( __METHOD__ ); |
88 | 99 | } |
89 | 100 | |
— | — | @@ -111,10 +122,27 @@ |
112 | 123 | } |
113 | 124 | |
114 | 125 | /** |
115 | | - * @param $path path to get fixmes for |
| 126 | + * @param $path array|string path to get fixmes for |
116 | 127 | * @return array |
117 | 128 | */ |
118 | 129 | private function getPathFixmes( $path ) { |
| 130 | + return $this->getStatusPath( $path, 'fixme' ); |
| 131 | + } |
| 132 | + |
| 133 | + /** |
| 134 | + * @param $path array|string path to get fixmes for |
| 135 | + * @return array |
| 136 | + */ |
| 137 | + private function getPathNews( $path ) { |
| 138 | + return $this->getStatusPath( $path, 'new' ); |
| 139 | + } |
| 140 | + |
| 141 | + /** |
| 142 | + * @param $path array|string |
| 143 | + * @param $status string |
| 144 | + * @return array |
| 145 | + */ |
| 146 | + private function getStatusPath( $path, $status ) { |
119 | 147 | $array = array(); |
120 | 148 | $dbr = wfGetDB( DB_SLAVE ); |
121 | 149 | $res = $dbr->select( |
— | — | @@ -123,7 +151,7 @@ |
124 | 152 | array( |
125 | 153 | 'cr_repo_id' => $this->repo->getId(), |
126 | 154 | 'cp_path' => $path, |
127 | | - 'cr_status' => 'fixme', |
| 155 | + 'cr_status' => $status, |
128 | 156 | ), |
129 | 157 | __METHOD__, |
130 | 158 | array( |
— | — | @@ -140,4 +168,4 @@ |
141 | 169 | } |
142 | 170 | return $array; |
143 | 171 | } |
144 | | -} |
\ No newline at end of file |
| 172 | +} |
Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -207,6 +207,8 @@ |
208 | 208 | 'code-stats-fixme-breakdown-path' => 'Breakdown of fixme revisions per path', |
209 | 209 | 'code-stats-fixme-path' => 'Fixme revisions for path: $1', |
210 | 210 | 'code-stats-new-breakdown' => 'Breakdown of new revisions per author', |
| 211 | + 'code-stats-new-breakdown-path' => 'Breakdown of new revisions per path', |
| 212 | + 'code-stats-new-path' => 'New revisions for path: $1', |
211 | 213 | 'code-stats-count' => 'Number of revisions', |
212 | 214 | |
213 | 215 | 'code-tooltip-withsummary' => 'r$1 [$2] by $3 - $4', |
Index: trunk/extensions/CodeReview/ui/CodeRepoStatsView.php |
— | — | @@ -56,6 +56,15 @@ |
57 | 57 | $this->writeAuthorTable( 'fixme', $fixmes, array( 'path' => $path ) ); |
58 | 58 | } |
59 | 59 | } |
| 60 | + |
| 61 | + if ( !empty( $stats->newPerPath ) ) { |
| 62 | + $wgOut->wrapWikiMsg( "<h3 id=\"stats-new-path\">$1</h3>", 'code-stats-new-breakdown-path' ); |
| 63 | + |
| 64 | + foreach ( $stats->newPerPath as $path => $news ) { |
| 65 | + $wgOut->wrapWikiMsg( "<h4 id=\"stats-new-path\">$1</h4>", array( 'code-stats-new-path', $path ) ); |
| 66 | + $this->writeAuthorTable( 'fixme', $news, array( 'path' => $path ) ); |
| 67 | + } |
| 68 | + } |
60 | 69 | } |
61 | 70 | |
62 | 71 | /** |