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

nobody at bestpractical.com nobody at bestpractical.com
Fri Oct 19 11:28:02 EDT 2007


Author: clsung
Date: Fri Oct 19 11:28:01 2007
New Revision: 2552

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

Log:
- not passing XD, just depot and path

Modified: branches/bm/lib/SVK/Project.pm
==============================================================================
--- branches/bm/lib/SVK/Project.pm	(original)
+++ branches/bm/lib/SVK/Project.pm	Fri Oct 19 11:28:01 2007
@@ -109,22 +109,16 @@
 }
 
 sub create_from_path {
-    my ($self, $xd, $arg) = @_;
+    my ($self, $depot, $path) = @_;
     my $root;
     my $rev = undef;
-    my ($depot, $path) = $xd->find_depotpath($arg);
-    my $view;
-    if (($view) = $path =~ m{^/\^([\w\-_/]+)$}) {
-	($path, $view) = $self->create_view($depot->repos, $view, $rev);
-    }
 
-    my $path_obj = $xd->create_path_object
-	( depot => $depot,
-	  path => $path,
-	  report => $arg,
-	  revision => $rev,
-	  view => $view,
-	);
+    my $path_obj = SVK::Path->real_new(
+        {   depot    => $depot,
+            path     => $path
+        }
+    );
+    $path_obj->refresh_revision;
 
     my $depotpath = $path_obj->{path};
     my ($project_name) = $depotpath =~ m{^/.*/([\w\-_]+)(?:/(?:trunk|branches|tags))?};

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 11:28:01 2007
@@ -21,7 +21,7 @@
 $svk->sync('//mirror/MyProject');
 
 # When the path is mirror path
-my $proj = SVK::Project->create_from_path($xd, '//mirror/MyProject');
+my $proj = SVK::Project->create_from_path($xd->find_depot(''), '//mirror/MyProject');
 isa_ok($proj, 'SVK::Project');
 
 my $proj2 = SVK::Project->new(


More information about the svk-commit mailing list