You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2004/02/07 00:33:16 UTC

Re: svn commit: r8577 - trunk/subversion/libsvn_ra_dav

sussman@tigris.org writes:

> Author: sussman
> Date: Fri Feb  6 18:11:25 2004
> New Revision: 8577

> +  do {

       svn_error_clear ?

> +    /* Get the latest baseline from VCC's DAV:checked-in property.
> +       This should give us the HEAD revision of the moment. */
> +    SVN_ERR( svn_ra_dav__get_one_prop(&baseline_url, cc->ras->sess,
> +                                      vcc->data, NULL,
> +                                      &svn_ra_dav__checked_in_prop, pool));
> +    baseline_rsrc.pool = pool;
> +    baseline_rsrc.vsn_url = baseline_url->data;
> +    
> +    /* To set the log message, we must checkout the latest baseline
> +       and get back a mutable "working" baseline.  */
> +    err = checkout_resource(cc, &baseline_rsrc, FALSE, pool);
> +
> +    /* There's a small chance of a race condition here, if apache is
> +       experiencing heavy commit concurrency or if the network has
> +       long latency.  It's possible that the value of HEAD changed
> +       between the time we fetched the latest baseline and the time we
> +       checkout that baseline.  If that happens, apache will throw us
> +       a BAD_BASELINE error (deltaV says you can only checkout the
> +       latest baseline).  We just ignore that specific error and
> +       retry a few times, asking for the latest baseline again. */
> +    if (err && err->apr_err != SVN_ERR_APMOD_BAD_BASELINE)
> +      return err;
> +
> +  } while (err && (--retry_count > 0));
> +
> +  /* Yikes, if we couldn't hold onto HEAD after a few retries, throw a
> +     real error.*/
> +  if (retry_count == 0)
> +    return err;

I had to think about out why this couldn't return SVN_NO_ERROR. I
think

      if (err)
         return err;

is clearer, but it's a marginal case.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org