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

nobody at bestpractical.com nobody at bestpractical.com
Wed Dec 19 04:25:56 EST 2007


Author: clsung
Date: Wed Dec 19 04:25:55 2007
New Revision: 2651

Modified:
   branches/bm/lib/SVK/Test.pm
   branches/bm/t/bm/prop-autoload.t

Log:
- try to mirror via project properties

Modified: branches/bm/lib/SVK/Test.pm
==============================================================================
--- branches/bm/lib/SVK/Test.pm	(original)
+++ branches/bm/lib/SVK/Test.pm	Wed Dec 19 04:25:55 2007
@@ -70,6 +70,7 @@
 		 tree_from_fsroot tree_from_xdroot __ _x not_x _l
 		 not_l uri set_editor replace_file glob_mime_samples
 		 create_mime_samples chmod_probably_useless
+		 add_prop_to_basic_tree
 
 		 catdir HAS_SVN_MIRROR IS_WIN32 install_perl_hook
 
@@ -506,6 +507,22 @@
     return $tree;
 }
 
+sub add_prop_to_basic_tree {
+    my ($xd, $depotpath, $props) = @_;
+    my $pool = SVN::Pool->new_default;
+    my ($depot, $path) = $xd->find_depotpath($depotpath);
+
+    local $/ = $EOL;
+    my $edit = get_editor ($depot->repospath, $path, $depot->repos);
+    $edit->open_root ();
+
+    my %prop = %{$props};
+    for my $key (keys %prop) {
+	$edit->change_dir_prop ('/', $key, $prop{$key});
+    }
+    $edit->close_edit ();
+}
+
 sub waste_rev {
     my ($svk, $path) = @_;
     $svk->mkdir('-m', 'create', $path);

Modified: branches/bm/t/bm/prop-autoload.t
==============================================================================
--- branches/bm/t/bm/prop-autoload.t	(original)
+++ branches/bm/t/bm/prop-autoload.t	Wed Dec 19 04:25:55 2007
@@ -19,35 +19,23 @@
 
 $svk->cp(-m => 'branch Foo', '//mirror/MyProject/trunk', '//mirror/MyProject/branches/Foo');
 
+$svk->mirror('--detach', '//mirror/MyProject');
 my ($copath, $corpath) = get_copath('basic-trunk');
 
-$svk->checkout('//mirror/MyProject/trunk', $copath);
-
-chdir($copath);
-
-my $proppath = { 'trunk' => '/mirror/MyProject/trunk', 
-    'branches' => '/mirror/MyProject/branches',
-    'tags' => '/mirror/MyProject/tags',
-    'hooks' => '/mirror/MyProject/hooks',
+my $props = { 
+    'svk:project:projectA:path-trunk' => '/mirror/projectA/trunk',
+    'svk:project:projectA:path-branches' => '/mirror/projectA/branches',
+    'svk:project:projectA:path-tags' => '/mirror/projectA/tags',
 };
 
-$svk->propset('-m', "- project trunk path set", 'svk:project:MyProject:path-trunk',
-    $proppath->{trunk}, "//"); 
-$svk->propset('-m', "- project branches path set", 'svk:project:MyProject:path-branches',
-    $proppath->{branches}, "//");
-$svk->propset('-m', "- project tags path set", 'svk:project:MyProject:path-tags',
-    $proppath->{tags}, "//");
-is_output ($svk, 'propget', ['svk:project:MyProject:path-trunk', '//'], [$proppath->{trunk}]);
+add_prop_to_basic_tree($xd, '/test/',$props);
+$answer = ['','','y',''];
+$svk->checkout($uri,$copath);
 
-is_output ($svk, 'branch', ['--list','//mirror/MyProject'], ['Foo']);
+chdir($copath);
+is_output ($svk, 'propget',
+    ['svk:project:projectA:path-trunk', '//mirror/projectA'],
+    [$props->{'svk:project:projectA:path-trunk'}]);
 
+is_output ($svk, 'branch', ['--list','//mirror/projectA'], ['Foo']);
 is_output ($svk, 'branch', ['--list'], ['Foo']);
-
-#$svk->mirror('--detach', '//mirror/MyProject');
-
-## { TODO interactive mode
-#$svk->mirror('//mirror/NewProject', $uri);
-
-
-# }
-#is_output ($svk, 'branch', ['--list','//mirror/NewProject'], ['Foo']);


More information about the svk-commit mailing list