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

15,375

Solution 1

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.

Solution 2

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.
Share:
15,375
Andreas
Author by

Andreas

Updated on June 05, 2022

Comments

  • Andreas
    Andreas about 2 years

    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?

  • David Mann
    David Mann almost 12 years
    I had many changes in my 'ccc' folder, so I dropped to command line, then 'cd' to the ccc directory as my working directory. Then I performed "find . -name .svn -type d -exec rm -rf {} \;' to remove all the svn metadata from the ccc folder. 'cd' back to the aaa directory. 'svn update' to fetch the 'ccc' directory from repository. 'svn rm ccc' to remove ccc from subversion. commit that change. Then 'cp -rf ccc' from the back up location that contains the ccc directory with no .svn metadata. 'svn add ccc' and commit.
  • Michael Laffargue
    Michael Laffargue over 10 years
    Work like charm, don't even know how all my entries got suddenly this "copied" line