Index: trunk/extensions/CodeReview/CodeRepository.php |
— | — | @@ -100,4 +100,9 @@ |
101 | 101 | throw new MWException( 'barf' ); |
102 | 102 | return CodeRevision::newFromRow( $row ); |
103 | 103 | } |
| 104 | + |
| 105 | + function getDiff( $rev ) { |
| 106 | + $svn = SubversionAdaptor::newFromRepo( $this->mPath ); |
| 107 | + return $svn->getDiff( '', $rev - 1, $rev ); |
| 108 | + } |
104 | 109 | } |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -233,12 +233,16 @@ |
234 | 234 | $paths = "<ul>\n$paths</ul>"; |
235 | 235 | } |
236 | 236 | $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> |
242 | 242 | </table>'; |
| 243 | + $html .= |
| 244 | + "<div class='mw-codereview-diff'>" . |
| 245 | + $this->formatDiff() . |
| 246 | + "</div>"; |
243 | 247 | $wgOut->addHtml( $html ); |
244 | 248 | } |
245 | 249 | |
— | — | @@ -257,4 +261,9 @@ |
258 | 262 | } |
259 | 263 | return "<li>$link ($desc)</li>\n"; |
260 | 264 | } |
| 265 | + |
| 266 | + function formatDiff() { |
| 267 | + $diff = $this->mRepo->getDiff( $this->mRev->getId() ); |
| 268 | + return "<pre>" . htmlspecialchars( $diff ) . "</pre>"; |
| 269 | + } |
261 | 270 | } |