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

Re: [Issue 1751] svn switch may corrupt working copy

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-03-08 21:44:13 CET

http://subversion.tigris.org/issues/show_bug.cgi?id=1751

Marvin Greenberg wrote:
> > From: Ben Collins-Sussman <sussman@collab.net>
> >
> > As long as you stay way from -N, you should be just fine.
>
> If you look at the case, it specifically says it isn't just "-N".

It says "Note: It is irrelevant for the recipe whether wc2 is checked out recursively or not." But, as I understand it, the "switch" command must be non-recursive for that recipe. I did some experiments to confirm this.

And it says "Changed summary, since a part of the problem occurs with recursive working copies too, and in all cases the working copy is dead." Again, as I understand it, this still referred only to problems caused by "switch --non-recursive".

However, there difinitely are problems also with fully recursive operation:

> I have had this happen doing really simple things like a switch from
> branches/br1 to branches/br2. No -N flag, nothing fancy. Resulting in
> a wedged working copy, with a rather painful process to recover, [...]

If you can make a recipe that reproduces the problem, that would be very helpful.

The very first thing mentioned in that issue is a (failed) plain switch command messing up a non-recursive WC (leaving it with a bad URL). I can reproduce something like that:

# Make a repository
svnadmin create repos
REPOS=file://`pwd`/repos

# Make a branch
svn mkdir -m "" $REPOS/branch1

# Check out a WC from branch1
svn co $REPOS/branch1 wc

# Show the correct info
svn info wc

# If "branch2" exists (empty), it is OK. If it does not exist, then it fails
# with "Cannot replace a directory from within", and leaves the WC with the
# wrong repository URL.
#svn mkdir -m "" $REPOS/branch2

# Try to switch WC to "branch2".
svn switch $REPOS/branch2 wc # Error: "Cannot replace a directory from within"

# Check the result
svn info wc # The URL is now wrong

I think we will agree that, while it would be acceptable to fail and leave the WC in an incomplete state (or any state that can easily be recovered from), a failure such as this should not leave the WC broken. There are other, similar failures such as the one in the issue in which the destination URL does exist but the switch fails with "Working copy 'www' not locked".

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 8 21:43:37 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.