xcode Subversion control 无此类文件或目录。无法打开文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6122210/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:06:33  来源:igfitidea点击:

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

xcodesvn

提问by Harold

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"

“svn:无法打开文件‘/Users/username/Projects/myproject/trunk/project/.svn/text-base/filetoupdate.h.svn-base’:没有这样的文件或目录”

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).

我有一个问题,我用一个新文件替换了项目(在 Xcode 中)中的一个文件(仅供参考,如果这有所不同,新文件的名称与我之前删除的文件名称相同)。

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).

现在,当我尝试在 Xcode 中提交更改时,我收到了上面详述的错误消息,但无法提交更改(即添加新文件)。

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).

在文件系统视图中(在屏幕左侧的 Xcode 中),文件旁边有一个 R(表示在存储库中已替换)。

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

有谁知道如何修复它以便我可以提交文件?

Thanks

谢谢

采纳答案by Harold

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.

如果您添加和删除具有相同名称的文件,则似乎SVN不喜欢它。我尝试通过终端清理 SVN,但对这个问题没有影响。但是更改名称确实对我有用。

回答by qris

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

在使用不区分大小写的文件系统时,Subversion 存在一个错误或限制:

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

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.

当检出包含两个名称不同的文件的存储库时,通常会出现此错误。当然,在不区分大小写的文件系统上,它们不能同时存在于同一目录中。SVN 可以给出更有帮助的错误信息,但它不能真正解决问题。

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-basewith the new case, while the old one still exists, and that is failing (for the same reason).

您的问题有点不同,因为我假设该文件filetoupdate.h(旧案例)不再存在于您的文件系统中。所以这不是工作目录中的大小写冲突。但是我猜想 SVN 正在尝试.svn/text-base使用新案例创建文件,而旧案例仍然存在,并且失败了(出于同样的原因)。

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:

您可以先尝试从 Subversion 中删除文件,保留本地副本(未经测试)。新副本必须从 SVN 控件中删除才能成功提交:

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.

如果这不起作用,您可能需要取消整个结帐并重新开始新结帐。

回答by Eric Larson

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.

您使用的是 Mac 还是 Windows?那些具有不区分大小写的文件系统,当
当前存在具有相同名称但大小写不同的文件时,会导致上述问题。

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

要修复 ,请在 Linux 机器上检出树,然后“svn rm”其中一个文件。

回答by yvoyer

Maybe your local version has permission issues. Check if your user have the permissions to write for the .svn directories.

也许您的本地版本有权限问题。检查您的用户是否具有写入 .svn 目录的权限。

good luck

祝你好运