Index: trunk/extensions/CodeReview/CodeRepository.php |
— | — | @@ -102,7 +102,20 @@ |
103 | 103 | } |
104 | 104 | |
105 | 105 | function getDiff( $rev ) { |
106 | | - $svn = SubversionAdaptor::newFromRepo( $this->mPath ); |
107 | | - return $svn->getDiff( '', $rev - 1, $rev ); |
| 106 | + global $wgMemc; |
| 107 | + |
| 108 | + $rev1 = $rev - 1; |
| 109 | + $rev2 = $rev; |
| 110 | + |
| 111 | + $key = wfMemcKey( 'svn', md5( $this->mPath ), 'diff', $rev1, $rev2 ); |
| 112 | + $data = $wgMemc->get( $key ); |
| 113 | + |
| 114 | + if( !$data ) { |
| 115 | + $svn = SubversionAdaptor::newFromRepo( $this->mPath ); |
| 116 | + $data = $svn->getDiff( '', $rev1, $rev2 ); |
| 117 | + $wgMemc->add( $key, $data, 86400 ); |
| 118 | + } |
| 119 | + |
| 120 | + return $data; |
108 | 121 | } |
109 | 122 | } |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | function formatMessage( $value ){ |
75 | 75 | $value = nl2br( htmlspecialchars( $value ) ); |
76 | 76 | $value = preg_replace_callback( '/\br(\d+)\b/', array( $this, 'messageRevLink' ), $value ); |
77 | | - $value = preg_replace_callback( '/\bbug (\d+)\b/i', array( $this, 'messageBugLink' ), $value ); |
| 77 | + $value = preg_replace_callback( '/\bbug #?(\d+)\b/i', array( $this, 'messageBugLink' ), $value ); |
78 | 78 | return $value; |
79 | 79 | } |
80 | 80 | |