r41953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41952‎ | r41953 | r41954 >
Date:00:05, 11 October 2008
Author:aaron
Status:old
Tags:
Comment:
* Update rev data if saving on an existing rev already, rather than doing nothing
* Allow svnImport.php to have a start rev param
Modified paths:
  • /trunk/extensions/CodeReview/CodeRevision.php (modified) (history)
  • /trunk/extensions/CodeReview/svnImport.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRevision.php
@@ -118,6 +118,20 @@
119119 'cr_path' => $this->mCommonPath ),
120120 __METHOD__,
121121 array( 'IGNORE' ) );
 122+ // Already exists? Update the row!
 123+ if( !$dbw->affectedRows() ) {
 124+ $dbw->update( 'code_rev',
 125+ array(
 126+ 'cr_author' => $this->mAuthor,
 127+ 'cr_timestamp' => $dbw->timestamp( $this->mTimestamp ),
 128+ 'cr_message' => $this->mMessage,
 129+ 'cr_status' => $this->mStatus,
 130+ 'cr_path' => $this->mCommonPath ),
 131+ array(
 132+ 'cr_repo_id' => $this->mRepo,
 133+ 'cr_id' => $this->mId ),
 134+ __METHOD__ );
 135+ }
122136
123137 if( $this->mPaths ) {
124138 $data = array();
Index: trunk/extensions/CodeReview/svnImport.php
@@ -6,7 +6,7 @@
77 require "$IP/maintenance/commandLine.inc";
88
99 if( !isset( $args[0] ) ){
10 - echo "Usage: php svnImport.php <repo>\n";
 10+ echo "Usage: php svnImport.php <repo> [<start>]\n";
1111 die;
1212 }
1313
@@ -24,9 +24,13 @@
2525
2626 $startTime = microtime( true );
2727 $revCount = 0;
28 -$start = $lastStoredRev + 1;
 28+$start = isset( $args[1] ) ? intval($args[1]) : $lastStoredRev + 1;
 29+if( $start > ($lastStoredRev + 1) ){
 30+ echo "Invalid starting point r{$start}\n";
 31+ die;
 32+}
2933
30 -echo "Syncing repo {$args[0]} from r$lastStoredRev to HEAD...\n";
 34+echo "Syncing repo {$args[0]} from r$start to HEAD...\n";
3135 while( true ) {
3236 $log = $svn->getLog( '', $start, $start + $chunkSize - 1 );
3337 if( empty($log) ) {

Status & tagging log