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

Re: [Issue 2380] New - 'svn switch --relocate' silently fails

From: <kfogel_at_collab.net>
Date: 2005-08-10 17:02:37 CEST

"Peter N. Lundblad" <peter@famlundblad.se> writes:
> Using 1.2.x, something like
> svn switch htp https
> (in a repository checked out using an http URL)
> has the same problem. svn switch --relocate only rewrites an URL prefix if
> the FROM argument matches (r15015 adds the check that the FROM argument
> must not be longer than the repository root if that's known).
> The problem is that this check is made for each entry, and it has to be
> that way because there is no guarantee that a working consistent regarding
> repository root. (I was, for example, able to svn switch --relocate a
> file, and you could have relocated just a subdirectory of your WC). And
> you can also have a working copy where the root directory doesn't have a
> repository root in its entry, but some subset of the WC has.
> So, we can't check the FROM argument before starting to relocate (or we
> could, in a separate pass, maybe), and it is legitimate for just a subset
> of a WC to be relocated by a relocate command.
> So, even if this is not strictly a bug, I agree that it is a usability
> problem. Maybe the best thing is to just warn afterwards if no entries
> were relocated. Maybe r15015 should have failed immediately when the FROM
> argument is longer than the repository root. In retrospect, I can't
> imagine when it would be good to continue in that case. We might leave an
> inconsistent WC behind anyway in some corner cases.

My issue didn't make this clear, but there were really two problems here:

   1) Why did the switch --relocate have no effect?
   2) Why was it silent about that fact?

I decided to file an issue about (2) only, because I figured once
Subversion is correctly reporting the reasons for the failure, we can
determine whether (1) was a bug or was expected behavior in this case.
Right now, I have no idea *why* the switch failed. (Perhaps it had
something to do with the fact that when I checked out a working copy
from the NEW repository, I was prompted for auth creds?)

So yes, I think it is appropriate to at least warn if the relocate has
no effect; it may even be appropriate to error, but we should at least
warn. I guess if we do a warning, we can suppress it with -q, which
might be desirable for some uses. What do you think?

By the way, just now I tried a slightly different version of the
command, like so:

   $ svn info | grep URL
   URL: http://svn.collab.net/repos/cvs2svn/trunk
   $ svn switch --relocate http://svn.collab.net/repos \
   $ svn info | grep URL
   URL: http://cvs2svn.tigris.org/svn/cvs2svn/trunk

So, this time it worked! Notice that this time I left the
"cvs2svn/trunk" off the end of the URLs. But there's another variable
too: this time I already had auth creds, and I don't know if that made
a difference. (I guess I should have saved the working copy, so I
could retry after clearing my stored auth creds, but I didn't think of
that in time, and it would be difficult to reconstruct it, and I can't
switch back because the OLD repository doesn't respond anymore.)

I've attached this thread to the issue, by the way.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 10 17:59:02 2005

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.