r83345 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83344‎ | r83345 | r83346 >
Date:00:45, 6 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Give a bit more information about why diff failed
Modified paths:
  • /trunk/extensions/CodeReview/api/ApiCodeDiff.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/CodeRepository.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRepository.php
@@ -515,4 +515,24 @@
516516 );
517517 return self::$authorLinks[$name] = $res;
518518 }
 519+
 520+ /**
 521+ * @static
 522+ * @param int $error
 523+ * @return string
 524+ */
 525+ public static function getDiffErrorMessage( $error ) {
 526+ switch( $error ) {
 527+ case self::DIFFRESULT_BadRevision:
 528+ return 'Bad revision specified.';
 529+ case self::DIFFRESULT_TooManyPaths:
 530+ return 'Too many paths returned to diff';
 531+ case self::DIFFRESULT_NoDataReturned:
 532+ return 'No data returned for diff';
 533+ case self::DIFFRESULT_NotInCache:
 534+ return 'Not in cache';
 535+ default:
 536+ return 'Unknown';
 537+ }
 538+ }
519539 }
Index: trunk/extensions/CodeReview/api/ApiCodeDiff.php
@@ -42,7 +42,7 @@
4343
4444 if ( !is_string( $diff ) ) {
4545 // FIXME: Are we sure we don't want to throw an error here?
46 - $html = 'Failed to load diff.';
 46+ $html = 'Failed to load diff. ' . CodeRepository::getDiffErrorMessage( $diff );
4747 } elseif ( strlen( $diff ) > $wgCodeReviewMaxDiffSize ) {
4848 $html = 'Diff too large.';
4949 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r83666makes it clear to the user that the diff error message is an error...hashar20:33, 10 March 2011
r88960[CodeReview] Follow-up to r83345. I've updated svnImport.php to use CodeRepo...happydog08:45, 27 May 2011

Status & tagging log