[svk-commit] r2914 - in trunk: lib/SVK

nobody at bestpractical.com nobody at bestpractical.com
Wed Jun 11 11:20:07 EDT 2008


Author: clsung
Date: Wed Jun 11 11:17:43 2008
New Revision: 2914

Modified:
   trunk/lib/SVK/Project.pm
   trunk/t/bm/prop-setup-inverse-layout.t

Log:
- prop-setup-inverse-layout implemented
  - no task # on http://task.hm/ (which cause me forgot to commit :p)

Modified: trunk/lib/SVK/Project.pm
==============================================================================
--- trunk/lib/SVK/Project.pm	(original)
+++ trunk/lib/SVK/Project.pm	Wed Jun 11 11:17:43 2008
@@ -188,12 +188,13 @@
 		my $prop = $allprops->{'svk:project:'.$project_name.':'.$_};
 		$prop =~ s{/$}{};
 		$prop =~ s{^/}{};
-		$_ => $prop_path.'/'.$prop }
+		$_ => $prop ? $prop_path.'/'.$prop : '' }
 		('path-trunk', 'path-branches', 'path-tags');
     
 	# only the current path matches one of the branches/trunk/tags, the project
 	# is returned
 	for my $key (keys %props) {
+	    next unless $props{$key};
 	    return SVK::Project->new(
 		{   
 		    name            => $project_name,

Modified: trunk/t/bm/prop-setup-inverse-layout.t
==============================================================================
--- trunk/t/bm/prop-setup-inverse-layout.t	(original)
+++ trunk/t/bm/prop-setup-inverse-layout.t	Wed Jun 11 11:17:43 2008
@@ -4,7 +4,7 @@
 # <clkao> it has trunk/[PROJNAME], branches/[PROJNAME]/* etc
 use strict;
 use SVK::Test;
-plan tests => 8;
+plan tests => 11;
 our $output;
 
 my ($xd, $svk) = build_test('test');
@@ -32,21 +32,24 @@
 is_output ($svk, 'branch', ['--list', '//mirror/nomeans/trunk/sushi'], []);
 
 is_output ($svk, 'branch', ['--list', '--project', 'sushi', '//mirror/nomeans'], []);
-is_output_like ($svk, 'branch', ['--create','bar','--project','sushi','//mirror/nomeans'],
+is_output_like ($svk, 'branch', ['--create','bar','--project','sushi'],
     qr'Project branch created: bar');
 is_output ($svk, 'branch', ['--list', '--project', 'sushi', '//mirror/nomeans'], ['bar']);
 $answer = [''];
 is_output ($svk, 'branch', ['--setup', '//mirror/nomeans/trunk/sushi'],
     ['Project already set in properties: //mirror/nomeans/trunk/sushi']);
 
-TODO: {
-local $TODO = 'no implemented yet';
 chdir($copath);
 
 is_output ($svk, 'branch', ['--list', '//mirror/nomeans/trunk/benshi'], []);
-$answer = ['', '','',''];
+$answer = ['n','','','','',''];
 is_output_like ($svk, 'branch', ['--setup', '//mirror/nomeans/trunk/benshi'],
     qr/Project detected in specified path./);
 is_output ($svk, 'branch', ['--setup', '//mirror/nomeans/trunk/benshi'],
     ['Project already set in properties: //mirror/nomeans/trunk/benshi']);
-}
+is_output_like ($svk, 'branch', ['--create','bar','--project','benshi'],
+    qr'Project branch created: bar');
+is_output_like ($svk, 'branch', ['--create','bar3','--project','benshi'],
+    qr'Project branch created: bar');
+is_output ($svk, 'branch', ['--list', '--project', 'benshi'],
+    ['bar','bar3']);


More information about the svk-commit mailing list