[svk-devel] Re: All Commands releasing giant_lock to early

Bernhard Weisshuhn bkw at weisshuhn.de
Thu Feb 22 20:18:08 EST 2007


On Fri, Feb 23, 2007 at 01:17:41AM +0100, Bernhard Weisshuhn <bkw at weisshuhn.de> wrote:

> Sorry, I'll do some more digging.

OK, I dugg ;-)

The following (simplified) code works:

  my $xd = SVK::XD->new ( ... );
  $xd->load();
  my $svk = SVK->new( xd=>$xd );

  if ($svk->ls("//$project")) {
    $svk->mirror($svnrepo,"//$project") && die;
  }
  $svk->sync("//$project");

  if ($svk->info($copath)) {
    $svk->{xd}->giant_lock(); #                    <===
    $svk->checkout("//$project/",$copath) && die;
    $svk->{xd}->store();      #                    <===
  }
  else {
    $svk->switch("//$project/",$copath) && die;
    $svk->update($copath) && die;
  }


Without the lines marked with the arrows, the statefile is not updated
with the new checkout, and thus subsequent runs fail.  I suspect other
commands changing checkouts and depotmap to have similar requirements.

Is this the recommended way to do it, or is this a bug in the locking
code and these things should work without the user taking care of the
locking?

regards,
  bkw





More information about the svk-devel mailing list