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

Re: svn commit: rev 3350 - trunk/subversion/mod_dav_svn

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-10-12 04:12:35 CEST

On Fri, Oct 11, 2002 at 06:27:26PM -0500, sussman@tigris.org wrote:
> Author: sussman
> Date: 2002-10-11 18:27:25 -0500 (Fri, 11 Oct 2002)
> New Revision: 3350
>
> Modified:
> trunk/subversion/mod_dav_svn/dav_svn.h
> trunk/subversion/mod_dav_svn/repos.c
> Log:
>
> * repos.c, dav_svn.h (dav_svn_is_new_resource): bugfix and
> extension. return two pieces of information: 1. the node_kind of the
> uri, 2. if a working resource, whether or not it's 'new' in the txn,
> i.e. didn't exist in the original rev.

Why two? The node_kind can tell you that the node isn't there. In fact, your
code already has that:

  *is_new = kind == svn_node_none;

(well, the real code is way more wordy, but there ya go)

The function should be something like dav_svn_get_resource_kind() and just
return the node kind. If the caller wants "newness", they just examine the
kind.

>...
> +++ trunk/subversion/mod_dav_svn/dav_svn.h Fri Oct 11 18:27:26 2002
>...
> + 1. what is the node_kind of the uri?
> +
> + 2. if the URI is a working resource, is it the path "new" in the
> + transaction? i.e. does this object exist in the original
> + revision?

Shouldn't it just *always* return the node kind in the original revision?

>...
> +++ trunk/subversion/mod_dav_svn/repos.c Fri Oct 11 18:27:26 2002
>...
> + /* Temporarily insert the uri that the user actually wants us to
> + convert into a resource. Typically, this is already r->uri, so
> + this is usually a no-op. But sometimes the caller may pass in
> + the Destination: header uri. */
> + saved_uri = r->uri;
> + r->uri = apr_pstrdup(r->pool, uri);

Eek! It might be best to leave a note in here that dav_svn_get_resource
should be refactored to take the relevant URI as a parameter.

>...
> @@ -1618,9 +1627,7 @@
> }
>
> return apr_psprintf(resource->pool, "\"%" SVN_REVNUM_T_FMT "/%s\"",
> - created_rev,
> - apr_xml_quote_string(resource->pool,
> - resource->info->repos_path, 1));
> + created_rev, resource->info->repos_path);
> }

Hey... did you copy a repos.c from somewhere else into your out of date
working copy? This blows away a change that Philip made.

>...
> @@ -2135,8 +2142,6 @@
> int depth,
> dav_response **response)
> {
> - svn_error_t *serr;
> -
> /* ### source must be from a collection under baseline control. the
> ### baseline will (implicitly) indicate the source revision, and the
> ### path will be derived simply from the URL path */
> @@ -2152,14 +2157,7 @@
> return dav_new_error(src->pool, HTTP_NOT_IMPLEMENTED, 0, msg);
> */
>
> - /* ### Safeguard: see issue #916, whereby we're allowing an
> - auto-checkout of a baseline for PROPPATCHing, *without* creating
> - a new baseline afterwards. We need to safeguard here that nobody
> - is calling COPY with the baseline as a Destination! */
> - if (dst->baselined && dst->type == DAV_RESOURCE_TYPE_VERSION)
> - return dav_new_error(src->pool, HTTP_PRECONDITION_FAILED, 0,
> - "Illegal: COPY Destination is a baseline.");
> -
> + svn_error_t *serr;
>
> serr = svn_fs_copy (src->info->root.root, /* the root object of src rev*/
> src->info->repos_path, /* the relative path of src */

AND you just blew away a bunch of your own changes.

Everybody give Ben a "tsk tsk" for copying files into a working copy :-)

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 12 04:11:03 2002

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.