Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve the svn error "Entry for 'xxx is marked as 'copied' but is not itself scheduled for addition."

Tags:

When I try to commit a specific file (xxx.java) following error pops up:

svn: Entry for 'C:\aaa/bbb/ccc/xxx.java' is marked as 'copied' but is not itself scheduled for addition.  Perhaps you're committing a target that is inside an unversioned (or not-yet-versioned) directory? 

How to solve this SVN-Error?

like image 211
Andreas Avatar asked Oct 06 '10 07:10

Andreas


2 Answers

I solved it with the following steps:

  1. Backup your changes in the folder "ccc"
  2. delete the folder "ccc".
  3. run "SVN UPDATE" on the top-folder "aaa"
  4. redo the changes in the file xxx.java
  5. Commit again

Then the commit worked.

like image 121
Andreas Avatar answered Oct 05 '22 15:10

Andreas


If you are checked out of a large source tree and want to avoid having to refresh everything, I have found another work-around for this problem. Since the alternative is to blow everything else away anyway, this is at least worth a shot (It worked for me).

Within the .svn folder you'll notice that you have an 'entries' file. If you open one of these guys up in the .svn folder where XXX.java is located, you'll see a bunch of 'copied' flags within the text. I'm not quite sure how yours got there, but mine came from playing around with VisaulSVN.

I have found that removing these copied flags from these entries files will cause the error to go away and allow you to commit again. A couple of notes :

  • note that the entries file is initially a ReadOnly file and you'll have to uncheck this to make the change, and re-check it when you're finished.
  • This copied flag may be in a couple of areas of the source tree, so you may end up having to fix several of these entries files.
  • Be careful that you keep the line numbers the same and just delete the 'copied' text from the file.
like image 43
Blake Avatar answered Oct 05 '22 14:10

Blake