开发者

SVN delete headache what am I doing wrong?

开发者 https://www.devze.com 2023-01-31 17:24 出处:网络
I am totally confused assuming I am in a working copy and do the following: svn mkdir trunk svn mkdir tags

I am totally confused assuming I am in a working copy and do the following:

svn mkdir trunk 
svn mkdir tags 
svn mkdir branches 
svn commit -m "added trunk branches and trunk" 
cd trunk 
touch a b c d e f g 
svn add a b c d e f g 
cd .. 
svn commit -m "added files"
svn copy trunk tags/1.0 
svn commit -m "tagged 1.0"

Now I want to delete a file and tag another version

 svn delete trunk/e
 svn commit -m "deleted file e"
 svn copy trunk tags/1.1
 svn commit -m "created tag 1.1"

I get an error message similar to the following:

/svn/repos/banana/!svn/wrk/1f39512a-开发者_Python百科0e1e-11e0-9d1f-5be991158436/63885/tags/1.1/e' path not found

What the heck am I doing wrong here?

Update:

I found that if I do an svn update after the delete everything works fine. I would like an explanation for this behavior.


This apparently is a known issue with Subversion, when working with deletes after commits. When you commit, your working copy becomes a mixed revision working copy, which then does not allow commits of deletes.

You can verify this by running svnversion before you do the updates/commits. You will notice the mixed revision is marked by a working copy version of something like "0:4".

From the Subversion best practices document:

Your working copy's directories and files can be at different "working" revisions: this is a deliberate feature which allows you to mix and match older versions of things with newer ones. But there are few facts you must be aware of:

  1. After every svn commit, your working copy has mixed revisions. The things you just committed are now at the HEAD revision, and everything else is at an older revision.
  2. Certain commits are disallowed:
    • You cannot commit the deletion of a file or directory which doesn't have a working revision of HEAD.
    • You cannot commit a property change to a directory which doesn't have a working revision of HEAD.
  3. svn update will bring your entire working copy to one working revision, and is the typical solution to the problems mentioned in point #2.

Book reference: The limitation of mixed revisions.

This is also explained nicely in this article about mixed revision working copies.


The error message also included this

svn: Commit failed (details follow): 
svn: File '1.1/e' is out of date

I found that if I do an svn update before the copy to tags it works

svn delete trunk/e   
svn commit -m "deleted file e"   
svn update 
svn copy trunk tags/1.1   
svn commit -m "created tag 1.1"

And that works fine. An explanation of this behavior would be appreciated.

0

精彩评论

暂无评论...
验证码 换一张
取 消