[svk-commit] r2644 - in branches/bm: t/bm

nobody at bestpractical.com nobody at bestpractical.com
Tue Dec 18 02:24:36 EST 2007


Author: clsung
Date: Tue Dec 18 02:24:33 2007
New Revision: 2644

Modified:
   branches/bm/lib/SVK/Project.pm
   branches/bm/t/bm/prop-multiproject.t

Log:
- fix the load_project_from_prop issue
  - < clkao> cls_bsd: oops, my change to load_project is buggy.
    now i am at the checkout of /bps/jifty/trunk, but br recognises svk:project:rt settings which is about /bps/mirror/rt
  - in fact, it's my changes to fail it, not clkao
- it will try to map the correct project from current copath
- pass the prop-multiproject.t now

Modified: branches/bm/lib/SVK/Project.pm
==============================================================================
--- branches/bm/lib/SVK/Project.pm	(original)
+++ branches/bm/lib/SVK/Project.pm	Tue Dec 18 02:24:33 2007
@@ -134,7 +134,9 @@
     
     return undef unless @projnames;
     
-    my $project_name = $projnames[0];
+    my ($relative_path) = $pathobj->path =~ m/^$mirror_rootpath\b(.*)/;
+    my ($project_name) = grep { $relative_path =~ /\b$_\b/} @projnames;
+
     my %props = 
 	map { $_ => $mirror_rootpath.$allprops->{'svk:project:'.$project_name.':'.$_} }
 	    ('path-trunk', 'path-branches', 'path-tags');

Modified: branches/bm/t/bm/prop-multiproject.t
==============================================================================
--- branches/bm/t/bm/prop-multiproject.t	(original)
+++ branches/bm/t/bm/prop-multiproject.t	Tue Dec 18 02:24:33 2007
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 use SVK::Test;
-plan tests => 3;
+plan tests => 4;
 our $output;
 
 my ($xd, $svk) = build_test('test');
@@ -28,10 +28,6 @@
 
 my ($copath, $corpath) = get_copath('basic-trunk');
 
-$svk->checkout('//mirror/twoProject/projectB', $copath); # checkout project B
-
-chdir($copath);
-
 # set prop for project A
 my $proppath = { 'trunk' => 'projectA/trunk', 
     'branches' => 'projectA/branches',
@@ -47,6 +43,25 @@
     $proppath->{tags}, "//");
 is_output ($svk, 'propget', ['svk:project:projectA:path-trunk', '//'], [$proppath->{trunk}]);
 
+# set prop for project B
+$proppath = { 'trunk' => 'projectB/trunk', 
+    'branches' => 'projectB/branches',
+    'tags' => 'projectB/tags',
+    'hooks' => 'projectB/hooks',
+};
+
+$svk->propset('-m', "- projectB trunk path set", 'svk:project:projectB:path-trunk',
+    $proppath->{trunk}, "//"); 
+$svk->propset('-m', "- projectB branches path set", 'svk:project:projectB:path-branches',
+    $proppath->{branches}, "//");
+$svk->propset('-m', "- projectB tags path set", 'svk:project:projectB:path-tags',
+    $proppath->{tags}, "//");
+is_output ($svk, 'propget', ['svk:project:projectB:path-trunk', '//'], [$proppath->{trunk}]);
+
+$svk->checkout('//mirror/twoProject/projectB', $copath); # checkout project B
+
+chdir($copath);
+
 # in checkout of project B, list
 is_output ($svk, 'branch', ['--list'], ['Bar']);
 


More information about the svk-commit mailing list