如何修复 Subversion/XCode 问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4233108/
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
How to fix Subversion/XCode problem
提问by Duncan C
I have a Mac project in XCode that is in a subversion repository.
我在 XCode 中有一个 Mac 项目,它位于 subversion 存储库中。
Subversion is set up on a remote server using svn+ssh.
Subversion 是使用 svn+ssh 在远程服务器上设置的。
I made several attempts to add a nested group of directories to my project, and had to delete and re-add the top-level directory a few times in getting it to work.
我多次尝试将一组嵌套目录添加到我的项目中,并且不得不多次删除并重新添加顶级目录才能使其正常工作。
In so doing, I forgot about the ".svn" files that subversion leaves at each level of your project hierarchy in order to keep track of the state of the check-out in the repository.
这样做时,我忘记了 subversion 在项目层次结构的每个级别留下的“.svn”文件,以便跟踪存储库中的检出状态。
I had used the XCode "add to repository" command to add the first version of my sub-directory to my working copy.
我曾使用 XCode“添加到存储库”命令将我的子目录的第一个版本添加到我的工作副本。
Now, when I try to check in a round of changes, I get a very un-helpful error:
现在,当我尝试检查一轮更改时,我收到一个非常无用的错误:
"Error: 155005 (Working copy not locked; this is probably a bug, please report) Description: Commit failed (details follow): Error: 155005 (Working copy not locked; this is probably a bug, please report) Description: Directory '/Development/FractalWorks/FractalWorks Plots/.svn' containing working copy admin area is missing"
“错误:155005(工作副本未锁定;这可能是错误,请报告)说明:提交失败(详细信息如下):错误:155005(工作副本未锁定;这可能是错误,请报告)说明:目录' /Development/FractalWorks/FractalWorks Plots/.svn' 包含工作副本管理区域丢失”
I need to figure out how to back out my add commands and get my working copy into a state so that I can check in my changes to the repository.
我需要弄清楚如何取消我的添加命令并使我的工作副本进入某种状态,以便我可以将我的更改签入到存储库中。
I'm fairly comfortable working in terminal and issuing svn commands there. I also have a registered version of the "versions" app, although I am not currently using it to manage this project.
我很习惯在终端工作并在那里发出 svn 命令。我也有一个“版本”应用程序的注册版本,虽然我目前没有使用它来管理这个项目。
Can somebody point me to some information on how to clean up a working copy, remove the vestiges of the "add to repository" commands that I did, so I can add the final subdirectory of files to my project and get it to commit?
有人可以向我指出一些有关如何清理工作副本的信息,删除我所做的“添加到存储库”命令的痕迹,以便我可以将文件的最终子目录添加到我的项目中并使其提交?
I find svn opaque and very hard to navigate, and the manual is not very informative. I have not seen any info on how to handle a case like this when the working copy gets out of sync with the repository. Any help would be greatly appreciated.
我发现 svn 不透明并且很难导航,而且手册的信息量也不是很大。当工作副本与存储库不同步时,我还没有看到有关如何处理此类案例的任何信息。任何帮助将不胜感激。
回答by JeremyP
svn revert file-i-added
will back out adds.
svn revert file-i-added
将退出添加。
However, the easiest way to get out of a situation like this is simply to check out a clean working copy. What you should do is:
然而,摆脱这种情况的最简单方法就是检查一个干净的工作副本。你应该做的是:
- move your current working copy somewhere else.
- check out a clean copy of the project hierarchy in the place where your working copy used to be.
- copy any changes from the moved working copy back in to the new one.
- 将您当前的工作副本移到其他地方。
- 在您的工作副本曾经所在的位置检查项目层次结构的干净副本。
- 将移动的工作副本中的任何更改复制回新的工作副本。
When doing the third step, take care not to replace directories in the new working copy with directories from the old working copy. Copy the content instead. If you find whole directories missing from the new working copy, you can recursively copy the directory from the old working copy and then svn add
the whole tree. But make sure you do not copy any .svn
directories from the old working copy. In fact you might want to run the following on your old working copy (make a back up first)
执行第三步时,注意不要用旧工作副本中的目录替换新工作副本中的目录。而是复制内容。如果您发现新工作副本中缺少整个目录,您可以从旧工作副本递归复制目录,然后svn add
是整个树。但请确保不要.svn
从旧的工作副本复制任何目录。事实上,您可能想在旧的工作副本上运行以下内容(先备份)
find old-working-copy-dir -name '.svn' -type d -exec rm -rf {} \;