[svk-commit] r2554 - in branches/bm: t/api

nobody at bestpractical.com nobody at bestpractical.com
Fri Oct 19 21:16:34 EDT 2007


Author: clsung
Date: Fri Oct 19 21:16:34 2007
New Revision: 2554

Modified:
   branches/bm/lib/SVK/Project.pm
   branches/bm/t/api/project_from_path.t

Log:
- guess mirror_path, too

Modified: branches/bm/lib/SVK/Project.pm
==============================================================================
--- branches/bm/lib/SVK/Project.pm	(original)
+++ branches/bm/lib/SVK/Project.pm	Fri Oct 19 21:16:34 2007
@@ -120,12 +120,12 @@
     );
     $path_obj->refresh_revision;
 
-    my $depotpath = $path_obj->{path};
-    my ($project_name) = $depotpath =~ m{^/.*/([\w\-_]+)(?:/(?:trunk|branches|tags))?};
+    my $depotname = $depot->depotname;
+    my ($mirror_path,$project_name) = 
+	$path_obj->depotpath =~ m{^/$depotname/(.*?)/([\w\-_]+(?=/(?:trunk|branches|tags))|[\w\-_]+$)};
 
     return 0 unless $project_name; # so? 0 means? need to deal with it.
 
-    my $mirror_path = "/mirror";
     my ($trunk_path, $branch_path, $tag_path) = 
 	map { $mirror_path."/".$project_name."/".$_ } ('trunk', 'branches', 'tags');
     # check trunk, branch, tag, these should be metadata-ed 

Modified: branches/bm/t/api/project_from_path.t
==============================================================================
--- branches/bm/t/api/project_from_path.t	(original)
+++ branches/bm/t/api/project_from_path.t	Fri Oct 19 21:16:34 2007
@@ -35,6 +35,6 @@
 
 is_deeply ($proj, $proj2, 'The same project?');
 
-my $proj3 = SVK::Project->create_from_path($xd->find_depot(''), '/mirror/MyProject/trunk/B/S/Q');
+my $proj3 = SVK::Project->create_from_path($xd->find_depot(''), '//mirror/MyProject/trunk/B/S/Q');
 isa_ok($proj3, 'SVK::Project');
 is_deeply ($proj, $proj3, 'The same project?');


More information about the svk-commit mailing list