[Rt-commit] r5960 - in commitbit: .

jesse at bestpractical.com jesse at bestpractical.com
Sat Sep 16 19:54:53 EDT 2006


Author: jesse
Date: Sat Sep 16 19:54:53 2006
New Revision: 5960

Modified:
   commitbit/   (props changed)
   commitbit/lib/CommitBit/Model/Repository.pm

Log:
 r27589 at pinglin:  jesse | 2006-09-17 00:54:18 +0100
 * muahahaha


Modified: commitbit/lib/CommitBit/Model/Repository.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/Repository.pm	(original)
+++ commitbit/lib/CommitBit/Model/Repository.pm	Sat Sep 16 19:54:53 2006
@@ -139,12 +139,32 @@
 }
 
 sub add_project {
-    my $self = shift;
+    my $self    = shift;
     my $project = shift;
 
-    $self->_svn('mkdir', '-p', -m => 'Project '.$project->name.' init by CommitBit '.$CommitBit::VERSION,
-		map { "file://".File::Spec::Unix->catdir($self->local_path, $project->root_path, $_)}
-	         'trunk', 'branches', 'tags');
+    my @project_structure = ( '', 'trunk', 'branches', 'tags' );
+
+    my @paths = map {
+        "file://"
+            . File::Spec::Unix->catdir( $self->local_path,
+            $project->root_path, $_ )
+    } @project_structure;
+
+    foreach my $path (@paths) {
+        $self->_svn( 'ls', $path );
+        if ($?) {    # If the path isn't there
+            $self->_svn(
+                'mkdir',
+                -m => 'Project '
+                    . $project->name
+                    . ' init by CommitBit '
+                    . $CommitBit::VERSION,
+                $path
+            );
+
+        }
+
+    }
 
     $self->write_authz_file();
 }
@@ -278,7 +298,7 @@
 sub run_cmd {
     my $self = shift;
     $self->log->debug("Running: ".join(' ', @_));
-    system(@_); $? &&  die $?;
+    system(@_); 
 
 }
 


More information about the Rt-commit mailing list