[svk-commit] r2880 - trunk/lib/SVK/Command

nobody at bestpractical.com nobody at bestpractical.com
Thu May 15 03:18:22 EDT 2008


Author: clsung
Date: Thu May 15 03:18:20 2008
New Revision: 2880

Modified:
   trunk/lib/SVK/Command/Branch.pm

Log:
- check if source_root equal to mirror root, if not
  - write props to local

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Thu May 15 03:18:20 2008
@@ -744,6 +744,8 @@
 
     my $local_root = $self->arg_depotpath('/'.$target->depot->depotname.'/');
     my ($trunk_path, $branch_path, $tag_path, $project_name, $preceding_path);
+    my $source_root = $target->is_mirrored->_backend->source_root;
+    my $url = $target->is_mirrored->url;
 
     for my $path ($target->depot->mirror->entries) {
 	next unless $target->path =~ m{^$path};
@@ -843,16 +845,20 @@
 	$self->{message} = "- Setup properties for project $project_name";
 	# always set to local first
 	my $root_depot = $self->arg_depotpath('/'.$target->depot->depotname.$preceding_path);
-	my $ret = $self->can_write_remote_proj_prop($root_depot,
+	my $ret = $source_root ne $url or $self->can_write_remote_proj_prop($root_depot,
 	    "svk:project:$project_name:path-trunk" => $trunk_path,
 	    "svk:project:$project_name:path-branches" => $branch_path,
 	    "svk:project:$project_name:path-tags" => $tag_path);
 	if ($ret) { # we have problem to write to remote
+	    if ($source_root ne $url) {
+		$logger->info( loc("Can't write project props to remote root. Save in local instead."));
+	    } else {
+		$logger->info( loc("Can't write project props to remote server. Save in local instead."));
+	    }
 	    $self->do_propset("svk:project:$project_name:path-trunk",$trunk_path, $local_root);
 	    $self->do_propset("svk:project:$project_name:path-branches",$branch_path, $local_root);
 	    $self->do_propset("svk:project:$project_name:path-tags",$tag_path, $local_root);
 	    $self->do_propset("svk:project:$project_name:root",$preceding_path, $local_root);
-	    $logger->info( loc("Can't write project props to remote server. Save in local instead."));
 	}
 	$proj = SVK::Project->create_from_prop($target);
 	# XXX: what if it still failed here? How to rollback the prop commits?


More information about the svk-commit mailing list