You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2002/10/12 02:12:35 UTC

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

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

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

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Ben Collins-Sussman <su...@collab.net> writes:
> Damn damn damn!  I was working with two working copies, and I could
> *swear* that they were both up-to-date.  I got stupid lazy and just
> copied files instead of patches.  I'm so stupid.

For the record, I deny you're stupid.  Tired, maybe.  So there! :-)

By the way, if anyone's wondering "Why didn't Ben just get an
out-of-date error?", the answer is that one of his working copies
(actually an exported tree) was not up-to-date, and from there he
copied a file into his up-to-date working copy, which of course
already had Philip's changes.

So don't worry, Subversion did not fail here.

-K


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

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

Posted by Ben Collins-Sussman <su...@collab.net>.
Greg Stein <gs...@lyra.org> writes:

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

Damn damn damn!  I was working with two working copies, and I could
*swear* that they were both up-to-date.  I got stupid lazy and just
copied files instead of patches.  I'm so stupid.

I'll fix this.

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