gwynne          Thu Nov  6 23:38:52 2008 UTC

  Modified files:              
    /SVNROOT    run-conversion.php 
  Log:
  corrected fixup rules, allow mkdir mode in fixup, add gd repo, add some 
unused modules to the exclusion list
  
http://cvs.php.net/viewvc.cgi/SVNROOT/run-conversion.php?r1=1.5&r2=1.6&diff_format=u
Index: SVNROOT/run-conversion.php
diff -u SVNROOT/run-conversion.php:1.5 SVNROOT/run-conversion.php:1.6
--- SVNROOT/run-conversion.php:1.5      Wed Nov  5 18:15:59 2008
+++ SVNROOT/run-conversion.php  Thu Nov  6 23:38:51 2008
@@ -2,7 +2,7 @@
 
 // 
-----------------------------------------------------------------------------------------------------------------------------
 // Constants
-$version = substr('$Revision: 1.5 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.6 $', strlen('$Revision: '), -2);
 
 $passes = array(
     'processcvs',       // Process CVS modules
@@ -287,35 +287,53 @@
         $converter->run();
     }
     
-    public function fixupRepository($ignoreErrors = FALSE)
+    private function executeSVNCommand($cmd)
+    {
+        $realCommand = "exec svn {$cmd} 2>&1";
+        v(2, "Running: '{$realCommand}'...");
+        exec($command, $output, $exitstatus);
+        if ($exitstatus != 0) {
+            error("\nAn error occurred. Exit status was {$exitstatus}. 
Output:\n" . implode("\n", $output) . "\n", $exitstatus);
+        }
+        v(2, " done.\n");
+        return $output;
+    }
+    
+    private function mkdirPath($path, $message)
+    {
+        $this->executeSVNCommand('mkdir -m ' . escapeshellarg($message) .
+                                 ' file:///' . 
escapeshellarg($this->svnRepositoryPath) . '/' . escapeshellarg($path));
+    }
+    
+    private function deletePath($path, $message)
+    {
+        $this->executeSVNCommand('rm -m ' . escapeshellarg($message) .
+                                 ' file:///' . 
escapeshellarg($this->svnRepositoryPath) . '/' . escapeshellarg($path));
+    }
+    
+    private function movePath($srcPath, $dstPath, $message)
+    {
+        $this->executeSVNCommand('mv -m ' . escapeshellarg($message) .
+                                 ' file:///' . 
escapeshellarg($this->svnRepositoryPath) . '/' . escapeshellarg($srcPath) .
+                                 ' file:///' . 
escapeshellarg($this->svnRepositoryPath) . '/' . escapeshellarg($dstPath));
+    }
+    
+    public function fixupRepository()
     {
         v(1, "Executing fixup commands for repository 
'{$this->repositoryName}'...\n");
+        $message = '[SVN CONVERSION] Reorganization in repository 
{$this->repositoryName}.';
         foreach ($renamingRules as $rule) {
             switch ($rule['mode']) {
-                case 'move_all':
-                    error("Moving tags and branches is not yet supported! TODO 
IMPLEMENT ME.\n");
+                case 'mkdir':
+                    $this->mkdirPath($rule['srcPath'], $message);
                     break;
                 case 'delete':
-                    $command  = "exec svn rm ";
-                    $command .= "-m '[SVN CONVERSION] Reorganization in 
repository {$this->repositoryName}.' ";
-                    $command .= "file:///" . 
escapeshellarg($this->svnRepositoryPath) . "/" . 
escapeshellarg($rule['srcPath']) . " 2>&1";
+                    $this->deletePath($rule['srcPath'], $message);
                     break;
                 case 'move':
-                    $command  = "exec svn mv ";
-                    $command .= "-m '[SVN CONVERSION] Reorganization in 
repository {$this->repositoryName}.' ";
-                    $command .= "file:///" . 
escapeshellarg($this->svnRepositoryPath) . "/" . 
escapeshellarg($rule['srcPath']) . " ";
-                    $command .= "file:///" . 
escapeshellarg($this->svnRepositoryPath) . "/" . 
escapeshellarg($rule['dstPath']) . " 2>&1";
+                    $this->movePath($rule['srcPath'], $rule['dstPath'], 
$message);
                     break;
             }
-            v(2, "Running: '{$command}'...");
-            exec($command, $output, $exitstatus);
-            if ($exitstatus != 0 && $ignoreErrors === FALSE) {
-                error("\nAn error occurred. Exit status was {$exitstatus}. 
Output:\n" . implode("\n", $output) . "\n", $exitstatus);
-            } else if ($exitStatus != 0) {
-                v(2, " warning: an error occurred\n");
-            } else {
-                v(2, " done.\n");
-            }
         }
         v(1, "Done fixing up.");
     }
@@ -356,6 +374,7 @@
     $repoList['web'] = new Repository('php-web');
     $repoList['phd'] = new Repository('phd');
     $repoList['pear1'] = new Repository('pear');
+    $repoList['gd'] = new Repository('gd');
     $repoList['other'] = new Repository('other');
 
     $cvs_modules = scandir_no_meta($options['cvsroot']);
@@ -366,7 +385,8 @@
         if (count(scandir($options['cvsroot'] . DIRECTORY_SEPARATOR . 
$cvs_module)) == 2) {    // empty
             continue;
         }
-        if (in_array($cvs_module, array("smarty", "smarty-web", 'php4.fubar', 
'php4.unused', 'peardoc.backup', 'php3', 'Zend'))) {
+        if (in_array($cvs_module, array('smarty', 'smarty-web', 'php4.fubar', 
'php4.unused', 'peardoc.backup', 'php3', 'phpfi', 'livedocs',
+                'Zend', 'functable', 'dialin', 'docstuff', 'jpgraph'))) {
             continue;
         } else if (in_array($cvs_module, array('php-gtk', 'php-gtk-doc', 
'old-php-gtk-modules'))) {
             $repoList['gtk']->addCVSModule($cvs_module);
@@ -375,6 +395,8 @@
             $repoList['src']->addCVSModule($cvs_module, $cvs_module == 'pecl');
         } else if ($cvs_module == 'phd') {
             $repoList['phd']->addCVSModule($cvs_module);
+        } else if ($cvs_module == 'gd') {
+            $repoList['gd']->addCVSModule($cvs_module);
         } else if (in_array($cvs_module, array('pear', 'pearbot', 'pear-core', 
'peardoc'))) {
             $repoList['pear1']->addCVSModule($cvs_module, $cvs_module == 
'pear');
         } else if (strncmp($cvs_module, "phpdoc", 6) == 0) {
@@ -386,11 +408,21 @@
         }
     }
     
+    // Fixup rules for php-doc
+    $repoList['doc']->addRenameRule(array('mode' => 'mkdir', 'srcPath' => 
'en'));
+    $repoList['doc']->addRenameRule(array('mode' => 'mkdir', 'srcPath' => 
'en/tags'));
+    $repoList['doc']->addRenameRule(array('mode' => 'mkdir', 'srcPath' => 
'en/branches'));
+    $repoList['doc']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'phpdoc/trunk/en', 'dstPath' => 'en/trunk'));
     $repoList['doc']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'phpdoc', 'dstPath' => 'doc-base'));
-    $repoList['doc']->addRenameRule(array('mode' => 'move_all', 'srcPath' => 
'doc-base/en', 'dstPath' => 'en'));
+    // Fixup rules for php-src
     $repoList['src']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'pdo-specs/trunk', 'dstPath' => 'php-src/ext/pdo/specs'));
-    $repoList['src']->addRenameRule(array('mode' => 'move_all', 'srcPath' => 
'ZendEngine2', 'dstPath' => 'php-src'));
-    $repoList['src']->addRenameRule(array('mode' => 'move_all', 'srcPath' => 
'TSRM', 'dstPath' => 'php-src'));
+    $repoList['src']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'ZendEngine2/trunk', 'dstPath' => 'php-src/trunk/ZendEngine2'));
+    $repoList['src']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'ZendEngine2/branches/PHP_5_2', 'dstPath' => 
'php-src/branches/PHP_5_2/ZendEngine2'));
+    $repoList['src']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'ZendEngine2/branches/PHP_5_3', 'dstPath' => 
'php-src/branches/PHP_5_3/ZendEngine2'));
+    $repoList['src']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'TSRM/trunk', 'dstPath' => 'php-src/trunk/TSRM'));
+    $repoList['src']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'TSRM/branches/PHP_5_2', 'dstPath' => 'php-src/branches/PHP_5_2/TSRM'));
+    $repoList['src']->addRenameRule(array('mode' => 'move', 'srcPath' => 
'TSRM/branches/PHP_5_3', 'dstPath' => 'php-src/branches/PHP_5_3/TSRM'));
+    // Fixup rules for pear1
     $repoList['pear1']->addRenameRule(array('mode' => 'delete', 'srcPath' => 
'pear/Selenium/branches/shin/.svn'));
     $repoList['pear1']->addRenameRule(array('mode' => 'delete', 'srcPath' => 
'pear/Selenium/branches/shin/tests/.svn'));
     $repoList['pear1']->addRenameRule(array('mode' => 'delete', 'srcPath' => 
'pear/Selenium/branches/shin/tests/events/.svn'));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to