tags:

views:

148

answers:

5

I'm trying to do a commit, and I'm getting the error above. I see a few questions on here along the same lines, but the solution always seems to be "delete and re-checkout". I'm trying to add some files for the first time, so I can't delete. I also tried just removing the files, but then I get this error instead:

svn: Directory '/path/to/dir' is missing

I think the problem originally stemmed from a permissions error -- I didn't have permission to write the .svn files when I did my initial add command. How can I fix this? The only thing I've thought of would be to clear out all .svn folders from the project, and re-import into a fresh repository. Bleh!

A: 

My best guess is that you need to step a level up in the directory hierarchy and then add the directory and the files from there, and commit from there.

Lars D
A: 

Try re-owning all the files as your current user. .svn files should be owned by whatever user is doing the commits. If you can commit as root, that would be a good indicator you have this problem. Don't do that though, because you'll make your subversion files owned by root, which means your user won't be able to commit. Set the owner properly and try again.

If you did indeed check the project out, and are now getting that error, it indicates that SVN doesn't believe you're in a valid repo. Check your path, check your permissions, check for the actual existence of .svn files.

Really, your most surefire way to fix the problem is to copy your edited files somewhere else, wipe the directory you checked out to, and then re-check out. If you haven't checked anything into the repo yet, use the svn import command.

Paul McMillan
+1  A: 

This question is hard to answer without the full context, but i'll give it a try.

What i've been forced to do a few times is this:

  1. Check out a fresh copy Backup my WC
  2. Delete all .svn directories in my WC
  3. Overwrite the fresh copy in (1) with my WC files.
  4. Commit

Other techniques are (after making a backup of course) Revert WC and then put the edited files in. Update (which probably will not work in your case)

This is pretty awkward and if there is a better way i'd be very interested to learn it as well.

The problem seems to appear due to revisions of deleted/added files that are in the wrong order.

Peter Lindqvist
A: 

You could try svn revert -R to first rollback to the last version before you made/added your changes. Once done, you can run an svn add again from the top most level of the folder structure (i am assuming that you are able to do this fine without permission issues. In command line client, when you run a revert, you will knock off the "A" status from those files (assuming those are the ones giving you grief over committing). So now these files are "outside of version control" although still in your workspace.

You can now move them out and add them back in phases (now that you have the right permissions it should work fine). But I dont know how many files you have in all, so this may not be a little messy.

Critical Skill
will the revert command delete my non-comitted files?
sprugman
Sorry - didnt see your question earlier, no it should not delete your added files. It should revert the status from "added" to "non-versioned" - however if you are like me, you'd prefer to be safer than sorry, so I'd try with one file after copying it elsewhere for safekeeping - like so svn revert "filename". Or perhaps you have already figured out something even better by now - so dont forget to post your resolution. curious to know what worked
Critical Skill
A: 

FWIW, I wound up using this:

find . -name ".svn" -type d -exec rm -rf {} \;

to remove all the .svn files and re-importing. I wasn't losing any history, really, so that seemed easiest....

Several of the other answers here seem viable, as well.

sprugman