[svk-commit] r3006 - in trunk: t/bm

nobody at bestpractical.com nobody at bestpractical.com
Thu Jul 24 04:52:43 EDT 2008


Author: clsung
Date: Thu Jul 24 04:52:42 2008
New Revision: 3006

Modified:
   trunk/lib/SVK/Command/Branch.pm
   trunk/t/bm/local-create.t

Log:
- implements http://task.hm/FC2C
  - just say 'no' and recommand rename dir to the user

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Thu Jul 24 04:52:42 2008
@@ -293,6 +293,17 @@
     $SVN::Node::none == $dst->root->check_path($dst->path)
 	or die loc("Project branch already exists: %1 %2\n",
 	    $branch_name, $self->{local} ? '(in local)' : '');
+    if ($self->{local} and $SVN::Node::none != $dst->root->check_path($proj->local_root)) {
+	my $trunk = SVK::Path->real_new(
+	    {   depot    => $proj->depot,
+		revision => $src->root->revision_root_revision,
+		path     => $proj->trunk
+	    }
+	);
+        my $lb = $trunk->mclone( path => $target->_to_pclass($proj->local_root) );
+	die loc("The local project root %1 is a branch itself.\n".
+	     "Please rename the directory and try again\n", $proj->local_root) if $lb->related_to($trunk);
+    }
 
     $self->{parent} = 1;
     $self->{message} ||= join(" ", "- Create", ($self->{tag} ? "tag" : "branch"), $branch_name);

Modified: trunk/t/bm/local-create.t
==============================================================================
--- trunk/t/bm/local-create.t	(original)
+++ trunk/t/bm/local-create.t	Thu Jul 24 04:52:42 2008
@@ -21,15 +21,12 @@
 
 my ($copath, $corpath) = get_copath('bm-local-create');
 
-$svk->cp(-m => 'local branch', '//mirror/MyProject/trunk', '//local/MyProject');
+$svk->cp(-m => 'local branch', '-p', '//mirror/MyProject/trunk', '//local/MyProject');
 
 $svk->checkout('//mirror/MyProject/trunk', $copath);
 
 chdir($copath);
 
-TODO: {
-local $TODO = 'see http://task.hm/FC2C';
 is_output ($svk, 'branch', ['--create', 'foobar', '--local'],
-    ['The local project path //local/MyProject is a branch.',
+    ['The local project root /local/MyProject is a branch itself.',
      'Please rename the directory and try again']);
-}


More information about the svk-commit mailing list