[svk-commit] r2163 - trunk/lib/SVK

clkao at bestpractical.com clkao at bestpractical.com
Sat Nov 18 00:15:45 EST 2006


Author: clkao
Date: Sat Nov 18 00:15:39 2006
New Revision: 2163

Modified:
   trunk/lib/SVK/Command.pm

Log:
In url autovivification:
* don't hold the giant lock.
* Report failure and tell users what to do.


Modified: trunk/lib/SVK/Command.pm
==============================================================================
--- trunk/lib/SVK/Command.pm	(original)
+++ trunk/lib/SVK/Command.pm	Sat Nov 18 00:15:39 2006
@@ -366,6 +366,9 @@
     die loc ("URI not allowed here: %1.\n", $no_new_mirror)
 	if $no_new_mirror;
 
+    # this is going to take a while, release giant lock
+    $self->{xd}->giant_unlock;
+
     print loc("New URI encountered: %1\n", $uri);
 
     my $depots = join('|', map quotemeta, sort keys %$map);
@@ -458,6 +461,8 @@
         $answer = 'a';
     }
 
+    eval {
+
     $self->command(
         sync => {
             skip_to => (
@@ -469,7 +474,16 @@
         }
     )->run ($target);
 
+    $self->{xd}->giant_lock;
+
+    };
+
     my $depotpath = length ($rel_uri) ? $target->depotpath."/$rel_uri" : $target->depotpath;
+    if (my $err = $@) {
+	print loc("Unable to complete initial sync: %1", $err);
+	die loc("Run svk sync %1, and run the %2 command again.\n", $depotpath, lc((ref($self) =~ m/::([^:]*)$/)[0]));
+    }
+
     return $self->arg_depotpath($depotpath);
 }
 


More information about the svk-commit mailing list