r43514 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43513‎ | r43514 | r43515 >
Date:01:02, 15 November 2008
Author:brion
Status:ok (Comments)
Tags:
Comment:
Revert r43512 -- I tested it partially but not well enough. Regression breaks revision detail view. :(
Modified paths:
  • /trunk/extensions/CodeReview/CodePathRevListView.php (added) (history)
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -40,9 +40,11 @@
4141 } elseif( $params[1] === 'comments' ) {
4242 $view = new CodeCommentsListView( $params[0] );
4343 break;
 44+ } elseif( $params[1] === 'path' ) {
 45+ $view = new CodePathRevListView( $params[0] );
 46+ break;
4447 } else {
45 - # Nonsense parameters, back out
46 - $view = new CodeRevisionListView( $params[0] );
 48+ $view = new CodeRevisionView( $params[0], $params[1] );
4749 break;
4850 }
4951 case 3:
Index: trunk/extensions/CodeReview/CodeRevisionListView.php
@@ -12,7 +12,6 @@
1313 $this->mPath = "/{$this->mPath}"; // make sure this is a valid path
1414 }
1515 $this->mAuthor = null;
16 - $this->mStatus = null;
1716 }
1817
1918 function execute() {
@@ -36,10 +35,8 @@
3736 global $wgOut, $wgScript;
3837 if( $this->mAuthor ) {
3938 $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/author/'.$this->mAuthor );
40 - } else if( $this->mStatus ) {
41 - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/status/'.$this->mStatus );
4239 } else {
43 - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() );
 40+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/path' );
4441 }
4542 $wgOut->addHTML(
4643 Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
Index: trunk/extensions/CodeReview/CodePathRevListView.php
@@ -0,0 +1,45 @@
 2+<?php
 3+
 4+// Special:Code/MediaWiki
 5+class CodePathRevListView extends CodeRevisionListView {
 6+ function __construct( $repoName ) {
 7+ parent::__construct( $repoName );
 8+ }
 9+
 10+ function execute() {
 11+ global $wgOut;
 12+ if( !$this->mRepo ) {
 13+ $view = new CodeRepoListView();
 14+ $view->execute();
 15+ return;
 16+ }
 17+ // No path! Use regular lister!
 18+ if( !$this->mPath ) {
 19+ $view = new CodeRevisionListView( $this->mRepo->getName() );
 20+ $view->execute();
 21+ return;
 22+ }
 23+ $this->showForm();
 24+ // Path should have a bit of length...
 25+ if( strlen($this->mPath) > 3 ) {
 26+ $pager = $this->getPager();
 27+ $wgOut->addHTML(
 28+ $pager->getNavigationBar() .
 29+ $pager->getLimitForm() .
 30+ $pager->getBody() .
 31+ $pager->getNavigationBar()
 32+ );
 33+ }
 34+ }
 35+
 36+ function getPager() {
 37+ return new SvnPathRevTablePager( $this );
 38+ }
 39+}
 40+
 41+// Pager for CodeRevisionListView
 42+class SvnPathRevTablePager extends SvnRevTablePager {
 43+ function getTitle() {
 44+ return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' );
 45+ }
 46+}
Property changes on: trunk/extensions/CodeReview/CodePathRevListView.php
___________________________________________________________________
Added: svn:eol-style
147 + native
Index: trunk/extensions/CodeReview/CodeReview.php
@@ -19,7 +19,7 @@
2020
2121 1) Find out what revisions exist
2222 2) Get id/author/timestamp/notice basics
23 -3) base path helps if available
 23+ 3) base path helps if available
2424 4) get list of affected files
2525 5) get diffs
2626
@@ -54,6 +54,7 @@
5555 $wgAutoloadClasses['CodeRevisionView'] = $dir . 'CodeRevisionView.php';
5656 $wgAutoloadClasses['CodeAuthorListView'] = $dir . 'CodeAuthorListView.php';
5757 $wgAutoloadClasses['CodeStatusListView'] = $dir . 'CodeStatusListView.php';
 58+$wgAutoloadClasses['CodePathRevListView'] = $dir . 'CodePathRevListView.php';
5859 $wgAutoloadClasses['CodeTagListView'] = $dir . 'CodeTagListView.php';
5960 $wgAutoloadClasses['CodeCommentsListView'] = $dir . 'CodeCommentsListView.php';
6061 $wgAutoloadClasses['CodeComment'] = $dir . 'CodeComment.php';

Follow-up revisions

RevisionCommit summaryAuthorDate
r43515Revert r43514 and fix rev detail view. I'm about ready to throw all this subp...aaron01:18, 15 November 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r43512Recover from r43499. Gotta love having all messages in a database :)siebrand23:59, 14 November 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   01:18, 15 November 2008

Woops wrong rev noted in commit msg :D

Reverted r43510

Status & tagging log