Subversion control No Such file or directory. Can't open file

11,339

Solution 1

It looks like something got confused somewhere. To fix, I simply copied the offending files, saved them under a new name. Removed the originals from the project and the added the copied (renamed) version of the file to the project.

It seems to be that SVN doesn't like it if you add and remove a file with the same name. I tried cleaning the SVN through terminal, but it had no affect on this issue. But changing the name did work for me.

Solution 2

There is a bug or limitation in Subversion when using case-insensitive filesystems:

https://superuser.com/questions/303348/cant-checkout-in-subversion

This bug normally shows up when checking out a repository that contains two files whose names differ only in case. Of course, these cannot exist at the same time in the same directory on a case-insensitive filesystem. SVN could give a much more helpful error message, but it can't really solve the problem.

Your issue is a bit different because I assume the file filetoupdate.h (with the old case) no longer exists in your filesystem. So it's not a case conflict in the working directory. But I guess that SVN is trying to create the file in .svn/text-base with the new case, while the old one still exists, and that is failing (for the same reason).

You could try deleting the file from Subversion first, keeping the local copy (untested). The new copy must be removed from SVN control for the commit to succeed:

svn rm --keep-local --force FileToUpdate.h

And the old copy must be removed as well, to allow us to add the new copy later:

svn rm --keep-local filetoupdate.h

Commit this change:

svn commit

Now hopefully you can add the new file to version control:

svn add FileToUpdate.h

If that doesn't work, you might need to blow away the whole checkout and start again with a fresh one.

Solution 3

Are you on a Mac or Windows? Those have case-insensitive filesystems which causes the above problem when
a file currently exists with the same name but with different cases.

To fix , checkout out the tree on a Linux machine, then "svn rm" one of the files.

Share:
11,339
Harold
Author by

Harold

Updated on June 07, 2022

Comments

  • Harold
    Harold almost 2 years

    Error message :

    "svn: Can't open file '/Users/username/Projects/myproject/trunk/project/.svn/text-base/filetoupdate.h.svn-base': No such file or directory"

    Question:

    I have an issue I've replaced a file in a project (in Xcode) with a new file (For reference and if this makes a difference, the new file has the same name as the one I deleted previously).

    Now when I try to commit my changes in Xcode I get the error message detailed above and am unable to commit the changes (i.e. adding the new file).

    In the file system view (in Xcode on the left hand side of the screen) the file has an R next to it (indicating Replaced in the repository).

    Does anyone know how to fix it so I can commit the files?

    Thanks