简体   繁体   English

无法解析与SVN的树冲突

[英]Can't resolve tree conflict with SVN

I recently encountered a very weird behavior of subversion. 我最近遇到了一个非常奇怪的颠覆行为。

I just merged my local copy of a branch with a remote branch. 我刚刚将分支的本地副本与远程分支合并。 Everything went smooth, but I've got 1 tree conflict (local delete, remote update). 一切顺利,但我有一个树冲突(本地删除,远程更新)。

Okay, thought I, modified the working copy appropriately and ran "svn resolve --accept=working -R .". 好吧,以为我,适当地修改了工作副本并运行了“svn resolve --accept = working -R。”。

Subversion told that it has resolved my problems and "svn st" no longer showed any issues. Subversion告诉它解决了我的问题并且“svn st”不再显示任何问题。 So, I tried to commit, but svn told me that one of the inner folders (inside my conflicted one) was out of date and suggested to svn up, BUT it made the folder to be in conflict again! 所以,我试图提交,但是svn告诉我,其中一个内部文件夹(在我冲突的文件夹中)已经过时并建议svn up,但它使文件夹再次发生冲突!

What shall I do to get out of this visious circle? 我该怎么做才能摆脱这个有意思的圈子?

~/sandbox/jabira > svn resolve  --accept=theirs-full testClient/
svn: warning: Tree conflicts can only be resolved to 'working' state; 'testClient' not resolved

~/sandbox/jabira  > svn resolve  --accept=working testClient/
Resolved conflicted state of 'testClient'

Hope this help 希望这有帮助

This may or may not help, but sometimes an "svn cleanup" will fix weird metadata issues. 这可能有所帮助,也可能没有帮助,但有时“svn cleanup”将修复奇怪的元数据问题。 If you check out a clean working copy, does the clean copy have the same issue? 如果您签出一份干净的工作副本,干净的副本是否也有同样的问题? If so then the previous answer sounds like a step in the right direction 如果是这样,那么之前的答案听起来像是朝着正确方向迈出的一步

You can use an other way than the svn resolve command: 您可以使用除svn resolve命令之外的其他方式:

  1. Create a patch of the conflicted file. 创建冲突文件的补丁。 (or a backup of your version of the conflicted folder with svn export ...) (或使用svn export备份您的冲突文件夹版本...)
  2. Update your repository (svn update) 更新您的存储库(svn更新)
  3. Apply the patch previously done (or replace the conflicted file/folder with the backup) 应用之前完成的补丁(或用备份替换冲突的文件/文件夹)
  4. Commit the change (svn commit) 提交更改(svn commit)

This is what worked for me to abandon all local changes and go with the files from the server repository: 这对我来说放弃所有本地更改并使用服务器存储库中的文件是有用的:

svn update --accept theirs-full

svn resolve --accept theirs-full <pathname>

This message appears: W155027: Tree conflict can only be resolved to 'working' 出现此消息:W155027:树冲突只能解析为“工作”

Unintuitive next step but this actually cuts the catch-22 : 不直观的下一步但这实际上削减了捕获22

svn resolve  --accept=working <pathname>

NOW revert all the "working" changes recursively. 现在递归地恢复所有“工作”的变化。 This undid all my local changes. 这解决了我当地的所有变化。

svn revert -R .

Back to normal, with no errors: 恢复正常,没有错误:

svn update

You probably didn't have your folders updated when you did the merge, or there was a conflict somewhere before the merge. 您在合并时可能没有更新文件夹,或者在合并之前某处发生了冲突。 To fix, you'd have to revert your trunk (target folder) to the previous revision. 要修复,您必须将主干(目标文件夹)还原到以前的版本。 Then run clean-up on that folder. 然后在该文件夹上运行清理。 Then run cleanup on the branch folder (source folder). 然后在分支文件夹(源文件夹)上运行清理。 Then update both folders again. 然后再次更新两个文件夹。 If you're getting lines in red in any workflow, then you need to revert those files first, then get them into the state that you want them in. Then update the folders (yes, once again). 如果您在任何工作流程中都获得了红色线条,那么您需要先恢复这些文件,然后让它们进入您想要的状态。然后更新文件夹(是的,再次)。 Finally perform the merge again. 最后再次执行合并。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM