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

nobody at bestpractical.com nobody at bestpractical.com
Wed Jun 11 01:41:02 EDT 2008


Author: clsung
Date: Wed Jun 11 01:41:01 2008
New Revision: 2913

Modified:
   branches/mirror-boostrap/lib/SVK/Command/Mirror.pm
   branches/mirror-boostrap/t/mirror/sync-bootstrap.t

Log:
- We have 'Bootstrapping mirror from dump' info while set bootstrap
- check the bootstrap file before initial the mirror

Modified: branches/mirror-boostrap/lib/SVK/Command/Mirror.pm
==============================================================================
--- branches/mirror-boostrap/lib/SVK/Command/Mirror.pm	(original)
+++ branches/mirror-boostrap/lib/SVK/Command/Mirror.pm	Wed Jun 11 01:41:01 2008
@@ -158,6 +158,10 @@
     my ($self, $target, $uri, @options) = @_;
     my ($m, $mpath) = $target->is_mirrored;
 
+    die loc("No such dump file: %1.\n", $self->{bootstrap})
+        unless $self->{bootstrap} eq '-' ||
+	$self->{bootstrap} eq 'auto' || -f ($self->{bootstrap});
+
     if (!$m) {
 	$self->SUPER::run($target,$uri, @options);
 	($m, $mpath) = $target->is_mirrored;
@@ -217,9 +221,6 @@
 
     }
 
-    die loc("No such dump file: %1.\n", $self->{bootstrap})
-        unless $self->{bootstrap} eq '-' || -f ($self->{bootstrap});
-
     $logger->info( loc("Bootstrapping mirror from dump") );
     $m->bootstrap($self->{bootstrap}, $hint); # load from dumpfile
     print loc("Mirror path '%1' synced from dumpfile.\n", $target->depotpath);

Modified: branches/mirror-boostrap/t/mirror/sync-bootstrap.t
==============================================================================
--- branches/mirror-boostrap/t/mirror/sync-bootstrap.t	(original)
+++ branches/mirror-boostrap/t/mirror/sync-bootstrap.t	Wed Jun 11 01:41:01 2008
@@ -26,7 +26,8 @@
 $svk->sync('/m2/m');
 
 is_output($svk, mirror => ['--bootstrap='.$dump, '//m', $uri],
-	  ['Mirror path \'//m\' synced from dumpfile.']);
+	  ['Bootstrapping mirror from dump',
+	   'Mirror path \'//m\' synced from dumpfile.']);
 
 # compare normal mirror result and bootstrap mirror result
 my ($exp_mirror, $boot_mirror);
@@ -50,7 +51,8 @@
           ["No such dump file: ./no-such-file."]);
 # this is real test
 is_output($svk, mirror => ['--bootstrap',$dump->filename, '/m3/m', $uri],
-          ["Mirror initialized.",
+	  ['Mirror initialized.  Run svk sync /m3/m to start mirroring.'
+	   'Bootstrapping mirror from dump',
 	   "Mirror path '/m3/m' synced from dumpfile."]);
 
 # compare UUID


More information about the svk-commit mailing list