r85671 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85670‎ | r85671 | r85672 >
Date:15:30, 8 April 2011
Author:reedy
Status:resolved
Tags:
Comment:
* (bug 28122) Path fragmenting results in all paths having the same modified property

Added "N" property for NOOP. IT doesn't get displayed
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -100,7 +100,13 @@
101101
102102 $currentPath .= $fragment;
103103
104 - $allPaths[] = array( 'path' => $currentPath, 'action' => $path['action'] ) ;
 104+ if ( $currentPath == $path['path'] ) {
 105+ $action = $path['action'];
 106+ } else {
 107+ $action = 'N';
 108+ }
 109+
 110+ $allPaths[] = array( 'path' => $currentPath, 'action' => $action );
105111 }
106112 }
107113
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -99,6 +99,10 @@
100100 $paths = '';
101101 $modifiedPaths = $this->mRev->getModifiedPaths();
102102 foreach ( $modifiedPaths as $row ) {
 103+ // Don't output NOOP paths
 104+ if ( strtolower( $row->cp_action ) == 'n' ){
 105+ continue;
 106+ }
103107 $paths .= $this->formatPathLine( $row->cp_path, $row->cp_action );
104108 }
105109 if ( $paths ) {
@@ -248,7 +252,7 @@
249253 global $wgUser;
250254 return $wgUser->isAllowed( 'codereview-signoff' ) && !$wgUser->isBlocked();
251255 }
252 -
 256+
253257 /**
254258 * @return bool Whether the current user can add and remove associations between revisions
255259 */
@@ -258,8 +262,14 @@
259263 }
260264
261265 protected function formatPathLine( $path, $action ) {
 266+ $action = strtolower( $action );
 267+
 268+ // If NOOP passed, return ''
 269+ if ( $action == 'n' ) {
 270+ return '';
 271+ }
262272 // Uses messages 'code-rev-modified-a', 'code-rev-modified-r', 'code-rev-modified-d', 'code-rev-modified-m'
263 - $desc = wfMsgHtml( 'code-rev-modified-' . strtolower( $action ) );
 273+ $desc = wfMsgHtml( 'code-rev-modified-' . $action );
264274 // Find any ' (from x)' from rename comment in the path.
265275 $matches = array();
266276 preg_match( '/ \([^\)]+\)$/', $path, $matches );

Follow-up revisions

RevisionCommit summaryAuthorDate
r90748* Fixed formatPathLine() to account for strtolower() on $action, broken since...aaron01:46, 25 June 2011

Status & tagging log