[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: more dav questions for gstein

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-04 01:11:46 CET

On Thu, Jan 03, 2002 at 12:23:43PM -0600, Ben Collins-Sussman wrote:
>
> So I'm teaching mod_dav_svn/liveprops.c to respond to new DAV
> properties, and one of the case statements already exists:
>
> case DAV_PROPID_version_name:
> /* only defined for Version Resources and Baselines */
> /* ### whoops. also defined for VCRs. deal with it later. */
> if (resource->type != DAV_RESOURCE_TYPE_VERSION)
> return DAV_PROP_INSERT_NOTSUPP;
> if (resource->baselined)
> {

this is a Baseline Resource

> /* just the revision number for baselines */
> value = apr_psprintf(p, "%ld", resource->info->root.rev);
> }
> else if (resource->info->node_id != NULL)
> {

this is a Version Resource opened using a /ver/... URL

> svn_stringbuf_t *id = svn_fs_unparse_id(resource->info->node_id, p);
>
> /* use ":ID" */
> value = apr_psprintf(p, ":%s", id->data);
> }
> else
> {

also a Version Resource, but reached in some other way

> /* assert: repos_path != NULL */
>
> /* use "REV:PATH" */
> value = apr_psprintf(p, "%ld:%s",
> resource->info->root.rev,
> resource->info->repos_path);
> }
> break;
>
>
> Apparently, up till now, this property has only been coming down on
> baseline collection PROPFINDs... I think. But now I want this

Just Baselines. The client doesn't explicitly ask for DAV:version-name on
any other type of resource.

>...
> property to come down with regular files and directories -- whenever
> we do a PROPFIND <allprop/> during normal checkouts and updates. I'm
> confused as to how this logic look. My first attempt was to simplify:
>...

simplify by fetching the revision for each branch, and...

> if (resource->baselined)
> {
> /* just the revision number for baselines */
> value = apr_psprintf(p, "%ld", resource->info->root.rev);

using this construct to create the value

>...
> /* Convert the revision into a quoted string */
> s = apr_psprintf(p, "%ld", committed_rev);
> value = apr_xml_quote_string(p, s, 1);

why quoted? doesn't need to be. it is just digits.

>...
> But this doesn't work; during checkouts and updates, I'm getting the
> new date and author props, but this one doesn't show up at all! I

Because resources in a Baseline Collection are REGULAR resources. Thus, the
code punts right off the bat, saying DAV:version-name isn't supported.

The specific problem here is that resources in a BC are supposed to be
Version Controlled Resources (pointing to Version Resources, of course).
There are also some semantics we want to keep for these, meaning to leave
them as a REGULAR resource.

> think my confusion is coming from not understanding the taxonomy of
> DAV resources very well:

It needs work; has for a while. The taxonomy was created a long while ago,
when John Vasta first did the DeltaV work. Now that DeltaV is "done", a
little revamp is probably in order.

So I did some poking. It seems that we want to make three changes:

1) in repos.c::dav_svn_parse_baseline_coll_uri(), we want to add the line:

    comb->res.versioned = TRUE;
   
   (insert at line 289)

2) for the DAV_PROPID_version_name case, we also want to allow REGULAR
   resources which are "versioned" (these are VCRs). so we change the
   condition to also allow REGULAR types and ->versioned resources.

3) line 481 of repos.c also needs an assignment of the .versioned flag.

I think that should do the trick, along with your restructure of the
DAV:version-name resource. The original code for version-name was done to
enable retrieval of the resource just given the name, but we don't need that
functionality. The URL exists for retrieval. So we can use the
DAV:version-name to mean the created-rev.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:54 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.