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

nobody at bestpractical.com nobody at bestpractical.com
Tue Jun 17 11:57:47 EDT 2008


Author: clsung
Date: Tue Jun 17 11:57:46 2008
New Revision: 2923

Added:
   trunk/t/bm/non-uri.t
Modified:
   trunk/lib/SVK/Command/Branch.pm

Log:
- add t/bm/non-uri.t

Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm	(original)
+++ trunk/lib/SVK/Command/Branch.pm	Tue Jun 17 11:57:46 2008
@@ -691,7 +691,7 @@
     return if $#arg != 0;
 
     my $dst = shift(@arg);
-    die loc ("Copy destination can't be URI.\n")
+    die loc ("Target can't be URI.\n")
 	if $self->ensure_non_uri ($dst);
 
     return ($self->arg_co_maybe ($dst));

Added: trunk/t/bm/non-uri.t
==============================================================================
--- (empty file)
+++ trunk/t/bm/non-uri.t	Tue Jun 17 11:57:46 2008
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+use strict;
+use SVK::Test;
+plan tests => 5;
+our $output;
+
+my ($xd, $svk) = build_test('test');
+
+$svk->mkdir(-m => 'trunk', '/test/trunk');
+$svk->mkdir(-m => 'trunk', '/test/branches');
+$svk->mkdir(-m => 'trunk', '/test/tags');
+my $tree = create_basic_tree($xd, '/test/trunk');
+
+my $depot = $xd->find_depot('test');
+my $uri = uri($depot->repospath);
+
+$svk->mirror('//mirror/MyProject', $uri);
+$svk->sync('//mirror/MyProject');
+
+$svk->cp(-m => 'branch Foo', '//mirror/MyProject/trunk', '//mirror/MyProject/branches/Foo');
+
+my ($copath, $corpath) = get_copath('non-uri');
+
+$svk->checkout('//mirror/MyProject/trunk', $copath);
+
+chdir($copath);
+
+is_output($svk, 'br', ['-l', $uri],
+          ['Foo'], 'default to guess project of current checkout');
+
+is_output($svk, 'br', ['-l', '//mirror/MyProject', $uri],
+          ['Foo']);
+my $fakeuri = 'http://localhost/non/exists';
+
+is_output($svk, 'br', ['-l', $fakeuri],
+          ['URI not allowed here: New mirror site not allowed here.'],
+	  'non-existent URI should alarm.');
+
+is_output($svk, 'br', ['-l', '//mirror/MyProject', $fakeuri],
+          ['URI not allowed here: New mirror site not allowed here.']);
+
+is_output($svk, 'br', ['--setup', $fakeuri],
+          ["Target can't be URI."]);


More information about the svk-commit mailing list