r79379 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79378‎ | r79379 | r79380 >
Date:22:55, 31 December 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
*(bug 23720) CodeReview doesn't show ancient revisions for a path

Start of bug, save all path fragments to code_paths table

e.g r78295

Instead of
/trunk/phase3/includes/search/SearchEngine.php
/trunk/phase3/includes/specials/SpecialSearch.php

save (obviously, not as php var_dump ;))
array(8) {
[0]=>
string(1) "/"
[1]=>
string(6) "/trunk"
[2]=>
string(13) "/trunk/phase3"
[3]=>
string(22) "/trunk/phase3/includes"
[4]=>
string(29) "/trunk/phase3/includes/search"
[5]=>
string(46) "/trunk/phase3/includes/search/SearchEngine.php"
[10]=>
string(31) "/trunk/phase3/includes/specials"
[11]=>
string(49) "/trunk/phase3/includes/specials/SpecialSearch.php"
}
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -22,6 +22,7 @@
2323 $rev->mOldStatus = '';
2424
2525 $common = null;
 26+ $allPaths = array();
2627 if ( $rev->mPaths ) {
2728 if ( count( $rev->mPaths ) == 1 ) {
2829 $common = $rev->mPaths[0]['path'];
@@ -47,6 +48,18 @@
4849 }
4950 }
5051 $common = $tmp;
 52+
 53+ $path = "/";
 54+ foreach( $compare as $partPath ) {
 55+
 56+ if ( $path !== "/" ) {
 57+ $path .= '/';
 58+ }
 59+
 60+ $path .= $partPath;
 61+
 62+ $allPaths[] = $path;
 63+ }
5164 }
5265 $common = implode( '/', $common );
5366
@@ -54,6 +67,7 @@
5568 }
5669 }
5770 $rev->mCommonPath = $common;
 71+ $rev->mPaths = $allPaths;
5872
5973 // Check for ignored paths
6074 global $wgCodeReviewDeferredPaths;

Follow-up revisions

RevisionCommit summaryAuthorDate
r79381More for bug 23720....reedy23:02, 31 December 2010
r79382Refactor out code added in r79379 so it can be reused in a maintenance scriptreedy23:21, 31 December 2010
r79384Add repopuldateCodePaths maintenance script for bug 23720 (untested, will be ...reedy23:32, 31 December 2010
r79390More refactoring and fixing for bug 23720reedy00:03, 1 January 2011
r79401Minor extra bit for bug 23720, remove performance restrictionreedy01:12, 1 January 2011
r81038(bug 23720) CodeReview doesn't show ancient revisions for a path...reedy17:27, 26 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78295Followup r78268, do it as Bryan suggested, not as how I'd interpretted it for...reedy11:06, 13 December 2010

Comments

#Comment by Catrope (talk | contribs)   03:37, 21 January 2011

Marking scaptrap, needs maintenance script run.

Status & tagging log