macos SVN(Subversion)问题“文件计划添加,但丢失” - 使用版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2247842/
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
SVN (Subversion) Problem "File is scheduled for addition, but is missing" - Using Versions
提问by Mike
I'm using Versions for SVN.
我正在使用 SVN 版本。
I attempt to commit and get this message:
我尝试提交并收到此消息:
Commit failed (details follow): '/Users/mike/Sites/mysite.com/astss-cvsdude/Trunk/cart/flashfile.swf' is scheduled for addition, but is missing
提交失败(详细信息如下):'/Users/mike/Sites/mysite.com/astss-cvsdude/Trunk/cart/flashfile.swf' 计划添加,但缺少
I suppose this is because I had added files to the repo, and then deleted them via the filesystem.
我想这是因为我已将文件添加到 repo,然后通过文件系统删除了它们。
I'd like to have it simply make note of my change, and apply the change to the repo.
我想让它简单地记下我的更改,并将更改应用于回购。
How can I get around this?
我怎样才能解决这个问题?
回答by MartinStettner
I'm not sure what you're trying to do: If you added the file via
我不确定您要做什么:如果您通过以下方式添加文件
svn add myfile
you only told svn to put this file into your repository when you do your next commit. There's no change to the repository before you type an
您只告诉 svn 在您下次提交时将此文件放入您的存储库。在您键入之前,存储库没有任何更改
svn commit
If you delete the file before the commit, svn
has it in its records (because you added it) but cannot send it to the repository because the file no longer exist.
如果您在提交前删除文件,svn
则将其记录在记录中(因为您添加了它)但无法将其发送到存储库,因为该文件不再存在。
So either you want to save the file in the repository and then delete it from your working copy: In this case try to get your file back (from the trash?), do the commit and delete the file afterwards via
因此,要么您想将文件保存在存储库中,然后将其从您的工作副本中删除:在这种情况下,尝试取回您的文件(从垃圾箱中?),然后通过提交并删除文件
svn delete myfile
svn commit
If you want to undo the add
and just throw the file away, you can to an
如果您想撤消add
并将文件扔掉,您可以
svn revert myfile
which tells svn
(in this case) to undo the add-Operation.
它告诉svn
(在这种情况下)撤消添加操作。
EDIT
编辑
Sorry, I wasn't aware that you're using the "Versions" GUI client for Max OSX. So either try a revert on the containing directory using the GUI or jump into the cold water and fire up your hidden Mac command shell :-) (it's called "Terminal" in the german OSX, no idea how to bring it up in the english version...)
抱歉,我不知道您正在使用 Max OSX 的“版本”GUI 客户端。因此,要么尝试使用 GUI 还原包含目录,要么跳入冷水并启动隐藏的 Mac 命令外壳 :-)(它在德国 OSX 中称为“终端”,不知道如何用英语调出它版本...)
回答by mmopy
I had the same problem with Versions displaying the same message. I simply right clicked the offending files and selected 'Revert...' from the right-click menu and all was good.
我在版本显示相同的消息时遇到了同样的问题。我只需右键单击有问题的文件并从右键单击菜单中选择“还原...”,一切都很好。
Basically Versions (actually Subversion) thinks you still want to add the file, but it cannot find it because you deleted it in the file system. The Revert option tells Subversion to forget about adding it.
基本上版本(实际上是Subversion)认为您仍然要添加该文件,但是由于您在文件系统中删除了它,因此找不到它。Revert 选项告诉 Subversion 忘记添加它。
回答by gbjbaanb
Adding a file, and then deleting it is the kind of operation that's considered an error - and so SVN is telling you. You told it to expect some file data and then don't supply it when you commit, the red lights flash and the sirens go off!
添加一个文件,然后删除它是一种被认为是错误的操作 - 所以 SVN 会告诉你。你告诉它期待一些文件数据,然后在你提交时不提供它,红灯闪烁,警报器响起!
The answer is to undo your add, alternatively commit the file and then use 'svn rm' to remove it from the filesystem and the repo.
答案是撤消您的添加,或者提交文件,然后使用“svn rm”将其从文件系统和存储库中删除。
回答by jose
回答by Totoro
Avoid using Xcode to rename files in a folder reference. If you rename a file using Xcode, it will be marked for commit. If you later delete it before the commit, you will end up with this error.
避免使用 Xcode 重命名文件夹引用中的文件。如果您使用 Xcode 重命名文件,它将被标记为提交。如果稍后在提交之前将其删除,则会出现此错误。
回答by Behzad Sedighzadeh
I just deleted the file from within VS, then from 'Repository Explorer', I copied the file to the working copy.
我刚刚从 VS 中删除了文件,然后从“存储库资源管理器”中,我将文件复制到了工作副本。
回答by Howard
If you're using TortoiseSVN…
如果你使用 TortoiseSVN…
From your commit window in the “Changes Made” section you can select all the offending files, then right-click and select delete. Finish the commit and the files will be removed from the scheduled additions.
从“已更改”部分的提交窗口中,您可以选择所有有问题的文件,然后右键单击并选择删除。完成提交,文件将从计划添加中删除。