Index: trunk/extensions/CodeReview/CodeRepository.php |
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | return CodeRevision::newFromRow( $row ); |
149 | 149 | } |
150 | 150 | |
151 | | - function getDiff( $rev ) { |
| 151 | + function getDiff( $rev, $skipCache = '' ) { |
152 | 152 | global $wgMemc; |
153 | 153 | |
154 | 154 | $rev1 = $rev - 1; |
— | — | @@ -159,7 +159,11 @@ |
160 | 160 | } |
161 | 161 | |
162 | 162 | $key = wfMemcKey( 'svn', md5( $this->mPath ), 'diff', $rev1, $rev2 ); |
163 | | - $data = $wgMemc->get( $key ); |
| 163 | + if( $skipCache === 'skipcache' ) { |
| 164 | + $data = NULL; |
| 165 | + } else { |
| 166 | + $data = $wgMemc->get( $key ); |
| 167 | + } |
164 | 168 | |
165 | 169 | if( !$data ) { |
166 | 170 | $svn = SubversionAdaptor::newFromRepo( $this->mPath ); |
Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -57,6 +57,7 @@ |
58 | 58 | 'code-rev-comment-preview' => 'Preview', |
59 | 59 | 'code-rev-diff' => 'Diff', |
60 | 60 | 'code-rev-diff-link' => 'diff', |
| 61 | + 'code-rev-purge-link' => 'purge', |
61 | 62 | 'code-status-new' => 'new', |
62 | 63 | 'code-status-fixme' => 'fixme', |
63 | 64 | 'code-status-resolved' => 'resolved', |
Index: trunk/extensions/CodeReview/CodeRevisionView.php |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | $this->mPreviewText = false; |
13 | 13 | $this->mReplyTarget = $replyTarget ? |
14 | 14 | (int)$replyTarget : $wgRequest->getIntOrNull( 'wpParent' ); |
| 15 | + $this->mSkipCache = ($wgRequest->getVal( 'action' ) == 'purge'); |
15 | 16 | } |
16 | 17 | |
17 | 18 | function execute(){ |
— | — | @@ -62,13 +63,12 @@ |
63 | 64 | $diffHtml = $this->formatDiff(); |
64 | 65 | if( $diffHtml ) { |
65 | 66 | $html .= |
66 | | - "<h2>" . wfMsgHtml( 'code-rev-diff' ) . "</h2>" . |
67 | | - "<div class='mw-codereview-diff'>" . |
68 | | - $diffHtml . |
69 | | - "</div>\n"; |
| 67 | + "<h2>" . wfMsgHtml( 'code-rev-diff' ) . |
| 68 | + ' <small>[' . $wgUser->getSkin()->makeLinkObj( $special, |
| 69 | + wfMsg('code-rev-purge-link'), 'action=purge' ) . ']</small></h2>' . |
| 70 | + "<div class='mw-codereview-diff'>" . $diffHtml . "</div>\n"; |
70 | 71 | } |
71 | | - $html .= |
72 | | - "<h2 id='code-comments'>". wfMsgHtml( 'code-comments' ) ."</h2>\n" . |
| 72 | + $html .= "<h2 id='code-comments'>". wfMsgHtml( 'code-comments' ) ."</h2>\n" . |
73 | 73 | $this->formatComments(); |
74 | 74 | |
75 | 75 | if( $this->mReplyTarget ) { |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | } |
230 | 230 | |
231 | 231 | function formatDiff() { |
232 | | - $diff = $this->mRepo->getDiff( $this->mRev->getId() ); |
| 232 | + $diff = $this->mRepo->getDiff( $this->mRev->getId(), $this->mSkipCache ? 'skipcache' : '' ); |
233 | 233 | if( !$diff ) { |
234 | 234 | return false; |
235 | 235 | } |