views:

243

answers:

6

I just managed to get into a weird situation with svn. One of my files seems 'lost' as far as the working copy is concerned. When I look on the server or do a fresh checkout of the containing folder in another location, the file is there, but in this one specific working copy it seems 'lost in space'.

svn status reports no changes (so not even a missing file)

svn update does nothing

I even tried re-exporting the file to my working copy, to no effect.

  • What is going on here?
  • How can I fix the working copy?

I would like to avoid having to resort to a fresh checkout of the whole working copy, if possible.

A: 

Try deleting that particular file from your local checkout only, and then do an update again.

Jage
The file is already missing, so this is a no-op and won't help.
Ether
+1  A: 

Do you have a pending delete for that file that you haven't committed yet?

Greg Hewgill
As stated in the question, svn status reports no changes.
jeroenh
+2  A: 

First, check that subversion has the same idea of what's in your working copy that you do, with svn info in the directory where the file should be. Is the URL the correct branch?

Next, check what uncommitted changes you have going on with svn update. Perhaps something has deleted that file? If so, simply revert the delete: svn revert <file>.

Next (after ensuring you have saved copies of anything you have changed in this directory), you can simply nuke the entire directory and refetch it: cd ..; rm -rf dir; svn update dir. That should re-create the directory, with your file in it.

Ether
+3  A: 

You should:

  • Verify that you're updating to the correct revision and that you're updating the current item and all its descendants... something like svn update --revision HEAD --depth infinity
  • Cleanup with svn cleanup and try again
Miguel Ventura
`--depth infinity` is the default. I think you meant `--set-depth infinity`, which turns shallow working copy folders into complete checkouts again.
Wim Coenen
Speaking of defaults, `--revision HEAD` is also unnecessary
Wim Coenen
@wcoenen although those are the defaults, if you explicitly checkout to some revision and to some depth, further updates will keep those settings and specifying the *defaults* again will make subversion stop maintaining the behavior. `set-depth` will however make the depth change sticky so +1 for that one! :)
Miguel Ventura
+1  A: 

I had this bug too. The problem certainly resides in the .svn directory of the file concerned. Try to replace this .svn directory with the corresponding one of a fresh (partial) checkout.

Patrick Allaert
+5  A: 

SVN 1.6.1 clients (including TortoiseSVN) had a bug where folders would sometimes erroneously be set to depth "empty". This causes the symptoms you describe. (Note that it's possible that the folder was made "empty" by svn 1.6.1 and has remained that way even though you've already upgraded to a newer svn client in the mean time.)

To fix it, use the "update to revision" menu item in TortoiseSVN and select the depth "fully recursive".

Wim Coenen
that fixed it, thanks!
jeroenh