Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -157,6 +157,12 @@ |
158 | 158 | $wgCodeReviewMaxDiffSize = 500000; |
159 | 159 | |
160 | 160 | /** |
| 161 | + * Limit of the revisions accessible to the search by path. |
| 162 | + * Set to 0 to disable the limit. |
| 163 | + */ |
| 164 | +$wgCodeReviewPathSearchHorizon = 20000; |
| 165 | + |
| 166 | +/** |
161 | 167 | * Key is repository name. Value is an array of regexes |
162 | 168 | * |
163 | 169 | * Any base paths matching regular expressions in these arrays will have their |
Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -934,7 +934,7 @@ |
935 | 935 | 'cp_repo_id' => $this->mRepoId, |
936 | 936 | 'cp_path ' . $dbr->buildLike( $path, $dbr->anyString() ), |
937 | 937 | // performance |
938 | | - 'cp_rev_id > ' . ( $this->mRepo->getLastStoredRev() - 20000 ), |
| 938 | + 'cp_rev_id > ' . $this->mRepo->getPathSearchHorizon(), |
939 | 939 | // join conds |
940 | 940 | 'cr_repo_id = cp_repo_id', |
941 | 941 | 'cr_id = cp_rev_id' |
Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -140,6 +140,15 @@ |
141 | 141 | return intval( $row ); |
142 | 142 | } |
143 | 143 | |
| 144 | + public function getPathSearchHorizon() { |
| 145 | + global $wgCodeReviewPathSearchHorizon; |
| 146 | + |
| 147 | + if( $wgCodeReviewPathSearchHorizon ) |
| 148 | + return $this->getLastStoredRev() - $wgCodeReviewPathSearchHorizon; |
| 149 | + else |
| 150 | + return 0; |
| 151 | + } |
| 152 | + |
144 | 153 | public function getAuthorList() { |
145 | 154 | global $wgMemc; |
146 | 155 | $key = wfMemcKey( 'codereview', 'authors', $this->getId() ); |
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | 'cr_id = cp_rev_id', |
202 | 202 | ' cp_path' . $dbr->buildLike( $this->mPath, $dbr->anyString() ), |
203 | 203 | // Performance |
204 | | - ' cp_rev_id > ' . ( $this->mRepo->getLastStoredRev() - 20000 ) |
| 204 | + ' cp_rev_id > ' . $this->mRepo->getPathSearchHorizon() |
205 | 205 | ); |
206 | 206 | // No path; count of code_rev |
207 | 207 | } else { |
— | — | @@ -252,7 +252,7 @@ |
253 | 253 | 'cp_repo_id' => $this->mRepo->getId(), |
254 | 254 | 'cp_path ' . $this->mDb->buildLike( $this->getSVNPath(), $this->mDb->anyString() ), |
255 | 255 | // performance |
256 | | - 'cp_rev_id > ' . ( $this->mRepo->getLastStoredRev() - 20000 ) |
| 256 | + 'cp_rev_id > ' . $this->mRepo->getPathSearchHorizon() |
257 | 257 | ), |
258 | 258 | 'options' => array( 'GROUP BY' => 'cp_rev_id', 'USE INDEX' => array( 'code_path' => 'cp_repo_id' ) ), |
259 | 259 | 'join_conds' => array( |