You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2010/07/22 17:59:42 UTC

RE: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update.c


> -----Original Message-----
> From: cmpilato@apache.org [mailto:cmpilato@apache.org]
> Sent: donderdag 22 juli 2010 19:55
> To: commits@subversion.apache.org
> Subject: svn commit: r966774 - /subversion/branches/issue-2779-
> dev/subversion/libsvn_client/update.c
> 
> Author: cmpilato
> Date: Thu Jul 22 17:54:49 2010
> New Revision: 966774
> 
> URL: http://svn.apache.org/viewvc?rev=966774&view=rev
> Log:
> On the 'issue-2779-dev' branch:  Get 'svn update' following redirects!
> 
> * subversion/libsvn_client/update.c
>   (update_internal): Check for a corrected URL from the RA subsystem
>     and, upon finding one, relocate the working copy before the update.
> 
> 
> Modified:
>     subversion/branches/issue-2779-
> dev/subversion/libsvn_client/update.c
> 
> Modified: subversion/branches/issue-2779-
> dev/subversion/libsvn_client/update.c
> URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-
> dev/subversion/libsvn_client/update.c?rev=966774&r1=966773&r2=966774&vi
> ew=diff
> =======================================================================
> =======
> --- subversion/branches/issue-2779-
> dev/subversion/libsvn_client/update.c (original)
> +++ subversion/branches/issue-2779-
> dev/subversion/libsvn_client/update.c Thu Jul 22 17:54:49 2010
> @@ -108,6 +108,7 @@ update_internal(svn_revnum_t *result_rev
>    const svn_ra_reporter3_t *reporter;
>    void *report_baton;
>    const char *anchor_url;
> +  const char *corrected_url;
>    const char *target;
>    const char *repos_root;
>    svn_error_t *err;
> @@ -192,10 +193,20 @@ update_internal(svn_revnum_t *result_rev
>      : NULL;
> 
>    /* Open an RA session for the URL */
> -  SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL,
> anchor_url,
> +  SVN_ERR(svn_client__open_ra_session_internal(&ra_session,
> &corrected_url,
> +                                               anchor_url,
>                                                 anchor_abspath, NULL,
> TRUE,
>                                                 TRUE, ctx, pool));
> 
> +  /* If we got a corrected URL from the RA subsystem, we'll need to
> +     relocate our working copy first. */
> +  if (corrected_url)
> +    {
> +      SVN_ERR(svn_client_relocate(anchor_abspath, anchor_url,
> corrected_url,
> +                                  TRUE, ctx, pool));
> +      anchor_url = corrected_url;
> +    }
> +

Shouldn't we relocate the complete working copy, starting by the working copy root instead of just the operation anchor?

This gives you a partly relocated working copy without proper notifications to the user. (In AnkhSVN there are a lot of users that update some part of their working copy. I would assume that this also applies to other clients)

	Bert

Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update. c

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Jul 22, 2010 at 09:53:02PM +0300, Daniel Shahaf wrote:
> Stefan Sperling wrote on Thu, Jul 22, 2010 at 20:11:23 +0200:
> > On Thu, Jul 22, 2010 at 07:59:42PM +0200, Bert Huijben wrote:
> > > Shouldn't we relocate the complete working copy, starting by the working copy root instead of just the operation anchor?
> > 
> 
> So "cd notes; svn up commit-access-templates" would relocate my entire trunk wc?
> 
> At the least, this departs from current semantics of svn.  I won't speak for
> "many users", but I, for one, would be surprised if svn started touching the
> parent of the dir I specified as target.
> 
> If this change is made, can we please add the appropriate big red letters
> somewhere?

This is svn switch --relocate, not svn switch.

If you switch --relocate a working copy, you are pointing to a different
server. It makes sense to relocate the entire working copy.
If you want nested working copies pointing to different servers,
you'd use an external.

Switched subtrees (i.e. without --relocate) are different, because we know
for certain that they are from the same repository.

Stefan

Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update. c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Stefan Sperling wrote on Thu, Jul 22, 2010 at 20:11:23 +0200:
> On Thu, Jul 22, 2010 at 07:59:42PM +0200, Bert Huijben wrote:
> > Shouldn't we relocate the complete working copy, starting by the working copy root instead of just the operation anchor?
> 

So "cd notes; svn up commit-access-templates" would relocate my entire trunk wc?

At the least, this departs from current semantics of svn.  I won't speak for
"many users", but I, for one, would be surprised if svn started touching the
parent of the dir I specified as target.

If this change is made, can we please add the appropriate big red letters
somewhere?

> I'm thinking a callback mechanism to ask users if they really
> want to relocate to the new URL would be nice. And I agree that
> the entire working copy should be relocated (should be easy in WC-NG,
> right? :)
> 
> Stefan

Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update.c

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 07/22/2010 02:11 PM, Stefan Sperling wrote:
> I'm thinking a callback mechanism to ask users if they really
> want to relocate to the new URL would be nice. And I agree that
> the entire working copy should be relocated (should be easy in WC-NG,
> right? :)

If you read the BRANCH-README, you'll see that my plan was to add runtime
configuration for permitting this behavior.  But the more I think about it,
the more a prompting callback makes much, much more sense.  It's not like we
expect these situations to arise often enough to necessitate Yet Another
Runtime Configuration Variable(tm) anyway, and the prompt will demand the
kind of user attention that I think this kind of decision merits.

Thanks, Stefan.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update.c

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Jul 22, 2010 at 07:59:42PM +0200, Bert Huijben wrote:
> 
> 
> > -----Original Message-----
> > From: cmpilato@apache.org [mailto:cmpilato@apache.org]
> > Sent: donderdag 22 juli 2010 19:55
> > To: commits@subversion.apache.org
> > Subject: svn commit: r966774 - /subversion/branches/issue-2779-
> > dev/subversion/libsvn_client/update.c
> > 
> > Author: cmpilato
> > Date: Thu Jul 22 17:54:49 2010
> > New Revision: 966774
> > 
> > URL: http://svn.apache.org/viewvc?rev=966774&view=rev
> > Log:
> > On the 'issue-2779-dev' branch:  Get 'svn update' following redirects!
> > 
> > * subversion/libsvn_client/update.c
> >   (update_internal): Check for a corrected URL from the RA subsystem
> >     and, upon finding one, relocate the working copy before the update.
> > 
> > 
> > Modified:
> >     subversion/branches/issue-2779-
> > dev/subversion/libsvn_client/update.c
> > 
> > Modified: subversion/branches/issue-2779-
> > dev/subversion/libsvn_client/update.c
> > URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-
> > dev/subversion/libsvn_client/update.c?rev=966774&r1=966773&r2=966774&vi
> > ew=diff
> > =======================================================================
> > =======
> > --- subversion/branches/issue-2779-
> > dev/subversion/libsvn_client/update.c (original)
> > +++ subversion/branches/issue-2779-
> > dev/subversion/libsvn_client/update.c Thu Jul 22 17:54:49 2010
> > @@ -108,6 +108,7 @@ update_internal(svn_revnum_t *result_rev
> >    const svn_ra_reporter3_t *reporter;
> >    void *report_baton;
> >    const char *anchor_url;
> > +  const char *corrected_url;
> >    const char *target;
> >    const char *repos_root;
> >    svn_error_t *err;
> > @@ -192,10 +193,20 @@ update_internal(svn_revnum_t *result_rev
> >      : NULL;
> > 
> >    /* Open an RA session for the URL */
> > -  SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL,
> > anchor_url,
> > +  SVN_ERR(svn_client__open_ra_session_internal(&ra_session,
> > &corrected_url,
> > +                                               anchor_url,
> >                                                 anchor_abspath, NULL,
> > TRUE,
> >                                                 TRUE, ctx, pool));
> > 
> > +  /* If we got a corrected URL from the RA subsystem, we'll need to
> > +     relocate our working copy first. */
> > +  if (corrected_url)
> > +    {
> > +      SVN_ERR(svn_client_relocate(anchor_abspath, anchor_url,
> > corrected_url,
> > +                                  TRUE, ctx, pool));
> > +      anchor_url = corrected_url;
> > +    }
> > +
> 
> Shouldn't we relocate the complete working copy, starting by the working copy root instead of just the operation anchor?

I'm thinking a callback mechanism to ask users if they really
want to relocate to the new URL would be nice. And I agree that
the entire working copy should be relocated (should be easy in WC-NG,
right? :)

Stefan

Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update. c

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 07/22/2010 03:01 PM, Daniel Shahaf wrote:
> C. Michael Pilato wrote on Thu, Jul 22, 2010 at 14:53:51 -0400:
>> On 07/22/2010 02:12 PM, C. Michael Pilato wrote:
>>> Hrm...  'svn relocate' just calls svn_client_relocate() as well.  I don't
>>> see any calls to svn_wc_is_wc_rootX() or anything.  Does that allow partial
>>> relocations, too?
>>
>> To answer my own question:  Yes.  'svn relocate', when run on a working copy
>> subtree, will only relocate that subtree.
>>
>> Am I wrong to think that this is ... odd?
>>
> 
> The way it is is consistent with every other subcommand.

Hey, nobody in this community is more vocal proponent of consistency than I
am.  :-)  But I do wonder about the utility of this particular sort of
consistency.  This isn't just a normal switch.  This is a relocation.  In
the context of Subversion 1.7-era functionality, what does it even mean to
have a single working copy whose citizens have different repository root
URLs?  I know there's a vision of supporting that situation someday (much as
CVS did with its working copy integration feature), but I'm not aware of
anyone specifically coding for it today.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update. c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
C. Michael Pilato wrote on Thu, Jul 22, 2010 at 14:53:51 -0400:
> On 07/22/2010 02:12 PM, C. Michael Pilato wrote:
> > Hrm...  'svn relocate' just calls svn_client_relocate() as well.  I don't
> > see any calls to svn_wc_is_wc_rootX() or anything.  Does that allow partial
> > relocations, too?
> 
> To answer my own question:  Yes.  'svn relocate', when run on a working copy
> subtree, will only relocate that subtree.
> 
> Am I wrong to think that this is ... odd?
> 

The way it is is consistent with every other subcommand.

Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update.c

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 07/22/2010 02:12 PM, C. Michael Pilato wrote:
> Hrm...  'svn relocate' just calls svn_client_relocate() as well.  I don't
> see any calls to svn_wc_is_wc_rootX() or anything.  Does that allow partial
> relocations, too?

To answer my own question:  Yes.  'svn relocate', when run on a working copy
subtree, will only relocate that subtree.

Am I wrong to think that this is ... odd?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update.c

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 07/22/2010 02:09 PM, C. Michael Pilato wrote:
> On 07/22/2010 01:59 PM, Bert Huijben wrote:
>>> -----Original Message-----
>>> From: cmpilato@apache.org [mailto:cmpilato@apache.org]
>>> Sent: donderdag 22 juli 2010 19:55
>>> To: commits@subversion.apache.org
>>> Subject: svn commit: r966774 - /subversion/branches/issue-2779-
>>> dev/subversion/libsvn_client/update.c
>>>
>>> Author: cmpilato
>>> Date: Thu Jul 22 17:54:49 2010
>>> New Revision: 966774
>>>
>>> URL: http://svn.apache.org/viewvc?rev=966774&view=rev
>>> Log:
>>> On the 'issue-2779-dev' branch:  Get 'svn update' following redirects!
> 
> [...]
> 
>> Shouldn't we relocate the complete working copy, starting by the working
>> copy root instead of just the operation anchor?
>>
>> This gives you a partly relocated working copy without proper
>> notifications to the user. (In AnkhSVN there are a lot of users that
>> update some part of their working copy. I would assume that this also
>> applies to other clients)
> 
> Ooh!  Good catch, Bert!
> 
> (No notifications have been added yet.  I believe they should be present in
> all cases, working copy root or otherwise.  I just haven't coded them yet.)

Hrm...  'svn relocate' just calls svn_client_relocate() as well.  I don't
see any calls to svn_wc_is_wc_rootX() or anything.  Does that allow partial
relocations, too?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r966774 - /subversion/branches/issue-2779-dev/subversion/libsvn_client/update.c

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 07/22/2010 01:59 PM, Bert Huijben wrote:
>> -----Original Message-----
>> From: cmpilato@apache.org [mailto:cmpilato@apache.org]
>> Sent: donderdag 22 juli 2010 19:55
>> To: commits@subversion.apache.org
>> Subject: svn commit: r966774 - /subversion/branches/issue-2779-
>> dev/subversion/libsvn_client/update.c
>>
>> Author: cmpilato
>> Date: Thu Jul 22 17:54:49 2010
>> New Revision: 966774
>>
>> URL: http://svn.apache.org/viewvc?rev=966774&view=rev
>> Log:
>> On the 'issue-2779-dev' branch:  Get 'svn update' following redirects!

[...]

> Shouldn't we relocate the complete working copy, starting by the working
> copy root instead of just the operation anchor?
> 
> This gives you a partly relocated working copy without proper
> notifications to the user. (In AnkhSVN there are a lot of users that
> update some part of their working copy. I would assume that this also
> applies to other clients)

Ooh!  Good catch, Bert!

(No notifications have been added yet.  I believe they should be present in
all cases, working copy root or otherwise.  I just haven't coded them yet.)

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand