mpen
mpen

Reputation: 282805

Need help fixing SVN: "not a working copy directory"

I had a folder, plugins/south which was checked into my repository. Then I needed to upgrade it, so I deleted the folder and put a new one in its place. Now I can't commit my changes.

In hindsight, I probably should have SVN deleted it, but it's too late for that now.

mark@ubuntu:~/myproject$ svn add plugins/south
svn: Working copy 'plugins' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
mark@ubuntu:~/myproject$ svn cleanup
svn: 'plugins/south' is not a working copy directory

How do I fix this?

Thought maybe I could delete the version in the repo and then check a new one in...

mark@ubuntu:~/myproject$ svn delete --keep-local plugins/south
svn: Working copy 'plugins' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)

But it won't let me do that either.

Upvotes: 2

Views: 23787

Answers (4)

kwantam
kwantam

Reputation: 441

You can also try

svn revert plugins/south

to get back the old version, then make changes as necessary.

Alternatively,

cd /tmp
svn co <stuff>/plugins
cd -
mv plugins plugins-old
mv /tmp/plugins .

or the moral equivalent.

Upvotes: 2

JOTN
JOTN

Reputation: 6317

Your problem is you deleted the entire directory along with the ".svn" directory that subversion uses. The way you should do it is "svn delete" the directory, commit to remove it from your local directory, create the new directory, and then "svn add" the new directory.

To clean up what you have, move your new directory to another location, do an "svn update" to bring the original back, svn delete it, commit, move your new directory back into place, and svn add it.

Upvotes: 2

MKroehnert
MKroehnert

Reputation: 3737

You can try to do an update of the deleted directory and then delete it with svn rmafterwards.

But before doing this you should move the new directory to not get into the way.

Upvotes: 1

richo
richo

Reputation: 8989

This working copy now isn't..

Your best bet imo (this may not be /right/ but it should work) is to check out the working copy elsewhere, then apply your changes from this set, then commit.

Upvotes: 4

Related Questions