[svk-commit] r2527 - in branches/mirror-boostrap: t/mirror

nobody at bestpractical.com nobody at bestpractical.com
Wed Aug 8 02:54:26 EDT 2007


Author: clkao
Date: Wed Aug  8 02:54:26 2007
New Revision: 2527

Added:
   branches/mirror-boostrap/t/mirror/sync-bootstrap.t
Modified:
   branches/mirror-boostrap/MANIFEST

Log:
todo test for mirror --bootstrap.

Modified: branches/mirror-boostrap/MANIFEST
==============================================================================
--- branches/mirror-boostrap/MANIFEST	(original)
+++ branches/mirror-boostrap/MANIFEST	Wed Aug  8 02:54:26 2007
@@ -299,6 +299,7 @@
 t/mirror/commit-copy.t
 t/mirror/dav-authz.t
 t/mirror/relocate.t
+t/mirror/sync-bootstrap.t
 t/mirror/sync-crazy-replace.t
 t/mirror/sync-empty.t
 t/mirror/sync-escape.t

Added: branches/mirror-boostrap/t/mirror/sync-bootstrap.t
==============================================================================
--- (empty file)
+++ branches/mirror-boostrap/t/mirror/sync-bootstrap.t	Wed Aug  8 02:54:26 2007
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w
+use strict;
+use Test::More;
+use SVK::Test;
+eval { require SVN::Mirror; 1 } or plan skip_all => 'require SVN::Mirror';
+plan tests => 4;
+
+my ($xd, $svk) = build_test('test', 'm2');
+
+our $output;
+
+my $tree = create_basic_tree($xd, '/test/');
+my $depot = $xd->find_depot('test');
+diag $depot->repospath;
+
+my $uri = uri($depot->repospath);
+
+my $dump = File::Temp->new;
+dump_all($depot => $dump);
+close $dump;
+
+is_output($svk, mirror => ['//m', $uri],
+          ["Mirror initialized.  Run svk sync //m to start mirroring."]);
+
+is_output($svk, mirror => ['/m2/m', $uri],
+          ["Mirror initialized.  Run svk sync /m2/m to start mirroring."]);
+$svk->sync('/m2/m');
+
+TODO: {
+
+local $TODO = 'not yet';
+is_output($svk, mirror => ['--bootstrap', '//m', $dump],
+	  []);
+
+# compare normal mirror result and bootstrap mirror result
+my ($exp_mirror, $boot_mirror);
+open my $exp, '>', \$exp_mirror;
+open my $boot, '>', \$boot_mirror;
+dump_all($xd->find_depot('') => $exp);
+dump_all($xd->find_depot('m2') => $boot);
+
+is($exp_mirror, $boot_mirror); # do something with UUID, they should be different
+
+};
+
+
+sub dump_all {
+    my ($depot, $output) = @_;
+    my $repos = $depot->repos;
+    SVN::Repos::dump_fs2($repos, $output, undef, 1, $repos->fs->youngest_rev, 0, 0, undef, undef);
+}


More information about the svk-commit mailing list