views:

613

answers:

2

It may sound stupid, but sometimes I run into version conflicts between two versions of subversion. I mount a directory on a development server with sshfs and then edit the code with my local Vim. For subversion stuff like updating, committing etc. I ssh on the server and do it there. However, sometimes I mix up my shells and accidently do an update or commit in my local shell in the mounted directory. Subversion exits with an error, which is fine. However, when I try to do the same thing on the development server in my ssh session, subversion says that the working directory/subversion has a wrong version. The subversion version on the server is older than the version on my notebook, so I guess my (newer) version somehow upgrades the working directories so they are incompatible with the old version on the development server. Sometimes deleting the .svn/lock files helps, but only if I do it right after I executed the subversion command on my notebook. When I execute the command on the development server afterwards, the lock files disappear and I don't see a way to rescue the checkout. This wouldn't be so bad if the repository wasn't that big. Especially when I made lots of changes and can't commit them.

The only solution I see at the moment is to copy the files I changed somewhere, remove the checkout, do a complete new checkout and copy the files back.

Is there a better solution to rescue a broken checkout and/or my changes?

UPDATE The FAQ Mikael Sundberg linked contained the answer. I write it down here, because he doesn't explictictly mention it. There's a script that can downgrade upgraded repositories, when it's safe:

http://svn.collab.net/repos/svn/trunk/tools/client-side/change-svn-wc-format.py

+1  A: 

Maybe this FAQ-entry could be helpful: http://subversion.tigris.org/faq.html#working-copy-format-change

Mikael Sundberg
A: 

I am not sure if I understand correctly your problem, but here are some tips:

First one tip -- did you try SVN Clean command?

The next one is probably useless for you:), but many people used to use CVS don't realize that SVN has feature like that, so I write it down.

If you use Windows and Tortoise SVN client you can choose Show Log command from context menu (right mouse button). When the list of check-ins appear choose the last good one one and choose from context menu command revert to this revision.

In other case (not Windows nor Tortoise SVN), investigate documentation for command-line version of commands described above.

Next tip could help you avoid mixing your shells.

You've written that you use SSH shell -- to avoid problems with mixing shell sessions I always use different background color for each server (and account), which I log-in (i.e. white on black for development, yellow on navy on testing server and yellow on green on production server).

This saves me many times :).

Grzegorz Gierlik
Thanks, but sadly after the repository is upgraded, Subversion doesn't do *any* commands anymore, not even `log` or `status`, so your solution won't work.
jkramer