简体   繁体   中英

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.

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.

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.

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM