使用svn时如何解决这个问题?
我实际上是在IDE中玩的:zend studio,它嵌入了svn工具,但我认为它应该与eclipse相同,甚至svn工具本身。
假设svn中有一个目录A,执行以下操作进行重现:
- 将A重命名为A2(IDE之外),然后刷新 >A在IDE中,它消失
- 刷新A2的父目录,在IDE中命名为P,然后A2出现
- 重命名 >A2回到A,然后刷新P,它报告:
刷新所选资源时出现问题:A2/.svn [in
] 不存在
现在如何解决此问题?
I'm actually playing this in IDE: zend studio,which embeds svn tool, but I think it should be the same with eclipse, and even svn tool itself.
Suppose there's a directory A in the svn, do the following to reproduce:
- rename A as A2(out of IDE), then refresh A in IDE,and it disappears
- refresh parent directory of A2,named P in IDE,then A2 appears
- rename A2 back to A,then refresh P,it reports:
Problems occured refreshing the selected resources: A2/.svn [in <project root>] does not exist
How to fix this issue now?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这实际上不是 SVN 应该如何工作的。对 SVN 中包含的目录结构、文件等的更改必须通过 IDE 或其他支持 SVN 的应用程序完成,而不是在文件系统本身上(即通过 Windows 资源管理器)完成。
SVN 实际上跟踪其文件系统的更改,当您使用 SVN“控制器”时,您会导致整个系统不同步。
This is actually not how SVN is supposed to work. Changes to directory structures, files, etc. that are contained in an SVN must be done through the IDE or other SVN-aware application, not on the file system itself (i.e. through Windows explorer).
SVN actually tracks changes to its file system, and when you work around the SVN "controller" you cause the whole thing to be out of sync.
乔希是对的。当您在 SVN 存储库中移动或重命名文件时,您必须使用 SVN 来执行此操作,这是绝对必要的。
Svn move
和svn rename
(后者是前者的别名)具有非常简单的语法。 TortoiseSVN 也支持该操作。以这种方式,下次另一个用户尝试执行 SVN 操作时,程序将看到存储库已更改。如果你不告诉存储库结构何时发生变化,你就会像这样混淆它。为了解决这个问题,我会:
Svn删除
A或A2。Svn 提交
。Svn add
A 或 A2。Svn 提交
。Josh is correct. It is absolutely essential when you move or rename a file in an SVN repository that you must use SVN to do so.
Svn move
andsvn rename
(the latter being an alias for the former) have very simple syntax. TortoiseSVN supports the operation as well. In this manner the next time another user tries to do an SVN operation, the program will see that the repository has changed. If you don't tell the repository when the structure changes, you're going to confuse it like this.To fix the problem, I would:
Svn delete
A or A2.Svn commit
.Svn add
A or A2.Svn commit
.