r40876 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40875‎ | r40876 | r40877 >
Date:19:53, 15 September 2008
Author:brion
Status:old
Tags:
Comment:
Code review UI fixes:
* Table alignment
* basic diff display
Modified paths:
  • /trunk/extensions/CodeReview/CodeRepository.php (modified) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRepository.php
@@ -100,4 +100,9 @@
101101 throw new MWException( 'barf' );
102102 return CodeRevision::newFromRow( $row );
103103 }
 104+
 105+ function getDiff( $rev ) {
 106+ $svn = SubversionAdaptor::newFromRepo( $this->mPath );
 107+ return $svn->getDiff( '', $rev - 1, $rev );
 108+ }
104109 }
Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -233,12 +233,16 @@
234234 $paths = "<ul>\n$paths</ul>";
235235 }
236236 $html = '<table>
237 -<tr><td>' . wfMsgHtml( 'code-rev-repo' ) . '</td><td>' . $repoLink . '</td></tr>
238 -<tr><td>' . wfMsgHtml( 'code-rev-rev' ) . '</td><td>' . $revText . '</td></tr>
239 -<tr><td>' . wfMsgHtml( 'code-rev-author' ) . '</td><td>' . $this->authorLink( $this->mRev->getAuthor() ) . '</td></tr>
240 -<tr><td>' . wfMsgHtml( 'code-rev-message' ) . '</td><td>' . $this->formatMessage( $this->mRev->getMessage() ) . '</td></tr>
241 -<tr><td>' . wfMsgHtml( 'code-rev-paths' ) . '</td><td>' . $paths . '</td></tr>
 237+<tr><td valign="top">' . wfMsgHtml( 'code-rev-repo' ) . '</td><td valign="top">' . $repoLink . '</td></tr>
 238+<tr><td valign="top">' . wfMsgHtml( 'code-rev-rev' ) . '</td><td valign="top">' . $revText . '</td></tr>
 239+<tr><td valign="top">' . wfMsgHtml( 'code-rev-author' ) . '</td><td valign="top">' . $this->authorLink( $this->mRev->getAuthor() ) . '</td></tr>
 240+<tr><td valign="top">' . wfMsgHtml( 'code-rev-message' ) . '</td><td valign="top">' . $this->formatMessage( $this->mRev->getMessage() ) . '</td></tr>
 241+<tr><td valign="top">' . wfMsgHtml( 'code-rev-paths' ) . '</td><td valign="top">' . $paths . '</td></tr>
242242 </table>';
 243+ $html .=
 244+ "<div class='mw-codereview-diff'>" .
 245+ $this->formatDiff() .
 246+ "</div>";
243247 $wgOut->addHtml( $html );
244248 }
245249
@@ -257,4 +261,9 @@
258262 }
259263 return "<li>$link ($desc)</li>\n";
260264 }
 265+
 266+ function formatDiff() {
 267+ $diff = $this->mRepo->getDiff( $this->mRev->getId() );
 268+ return "<pre>" . htmlspecialchars( $diff ) . "</pre>";
 269+ }
261270 }

Status & tagging log