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

Re: relocate doesn't check arguments - may screw up working copy

From: Mark Benedetto King <mbk_at_lowlatency.com>
Date: 2004-05-14 15:13:38 CEST

On Thu, May 13, 2004 at 09:52:50PM +0200, SteveKing wrote:
> Max Bowsher wrote:
> >The problem here is that Ben and I have been attempting to help you
> >to understand the current functionality whilst you seem to be
> >simultaneously proposing new functionality.
> >
> >We can all agree that invalid input to svn switch --relocate should
> >cause an error, not break the working copy.
> >
> >If you really think that the syntax for switch --relocate should be
> >changed, it would be best to start a new thread with a more
> >appropriate subject, as that would require discussion of the design
> >and thoughts about compatibility guarantees.
> Oops. Sorry. First I just tried to think about ways how to overcome the
> lack of sanity checking, but I guess I went a little too far and came to
> a new feature. You're right. Sorry.
> So then I'd like to propose a way to do the sanity checking:
> right now, the relocate command checks if the "to" URL has the same
> repository uuid as the working copy. You can see that in the source and
> by trying to relocate to a nonexisting "to" URL or to a "to" URL which
> has a completely different repository there.
> So I think it would be best if the uuid comparison isn't done with the
> "to" URL but with the *resulting* URL of the string replacement.
> Or would that break the way this command is supposed to work?
> Stefan

It does check that the resulting URL is valid. Or, at least,
it tries to.

For each new URL generated, it calls validator_func() in
libsvn_client/relocate.c, passing the old UUID and the new URL.

To avoid a new RA connection in order to test each new URL, it
uses a cached mapping of already-determined URL -> UUID pairs.
If any of the pre-resolved URLs are prefixes of the new URL,
it uses their UUID.

I haven't looked into your specific case, but my assumption
is that you're running into the same problem that would happen
if you tried to do

svn switch --relocate \
    http://svn.collab.net/repos/svn/trunk \

The switch would "succeed" because all of the computed URLs
would fall under http://svn.collab.net/repos/svn/branches,
which has the same UUID as the original URLs, but the
resulting WC would not be valid.

Do you have a different problem, or would adding path
validation (which was not possible before RA->get_repos_root()
was added) fix your issue?


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 14 16:19:02 2004

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.