Discussion:
Recovering from svn switch crash
Marcus Williams
2007-12-14 10:04:16 UTC
Permalink
Hi -

I used svn switch to switch a working copy to a branch and the switch
died half way through (not due to svn). I was wondering how to recover
from this without destroying the working copy.

The steps leading up to the switch were:

1. I branched the working copy after commiting everything under version
control (note that there are a lot of dirs in the wc not under source
control)
2. I then used svn switch to switch the wc to the branch - no edits were
made in between the commit/branch in (1) and the switch
3. switch died.

At this point I've got a wc thats half switched and fairly broken. How
should I recover from this without losing the unversioned files? I
noticed theres a bug against svn when using the switch on wc's with
unversioned content but I dont know if this affects me in this case.

Thanks

Marcus
John Peacock
2007-12-14 11:35:12 UTC
Permalink
Post by Marcus Williams
At this point I've got a wc thats half switched and fairly broken. How
should I recover from this without losing the unversioned files? I
noticed theres a bug against svn when using the switch on wc's with
unversioned content but I dont know if this affects me in this case.
Why did the switch stop? Do you have an unversioned file or folder with the
same name as a versioned file or folder in the new revision? That's the primary
reason why a switch will normally fail. In that case, you just need to rename
that file or folder out of the way for the moment.

However, in general, you can continue running the same switch command multiple
times, fixing any problems you find along the way (like conflicting
non-versioned files and folders). The reason for this is that each directory is
completely independent of the others, so once you are successful at switching
one folder, it will be unchanged by running the command again.

John
Marcus Williams
2007-12-14 11:46:51 UTC
Permalink
Post by John Peacock
Why did the switch stop? Do you have an unversioned file or folder
with the same name as a versioned file or folder in the new revision?
That's the primary reason why a switch will normally fail. In that
case, you just need to rename that file or folder out of the way for
the moment.
I'm not sure why it stopped unfortunately as I lost my network
connection during the switch (that may have been the cause of it). The
unversioned files & directories are exactly the same in both branch and
trunk.

At this point in time there should be no difference between the branch
and the trunk as no edits have been made. So I was hoping I could
switch to the branch without moving unversioned files out of the way as
they would be needed in the branch as well. The unversioned files are
mainly auto-generated content and large directories of images (10k+
files) - the working copy is used directly on a development website.
Post by John Peacock
However, in general, you can continue running the same switch command
multiple times, fixing any problems you find along the way (like
conflicting non-versioned files and folders). The reason for this is
that each directory is completely independent of the others, so once
you are successful at switching one folder, it will be unchanged by
running the command again.
Ah ok, so I should just be able to kick off the switch again and it'll
sort itself out?

Thanks

Marcus
John Peacock
2007-12-14 14:26:22 UTC
Permalink
Post by Marcus Williams
Ah ok, so I should just be able to kick off the switch again and it'll
sort itself out?
Exactly. If the files are all identical, then the only thing switch
needs to do is bookkeeping (change the .svn directory contents). This
should be very fast.

John

Loading...