TortoiseSVN 解决树冲突的方法
TortoiseSVN 可以使用编辑冲突窗口帮助解决多种树冲突。
问题是,如果出现“...合并时”冲突类型,TortoiseSVN 无法猜测哪些文件需要合并。
例如,(情况:本地丢失,更新时传入删除)
- 在主干上工作的开发人员 A 修改文件 Foo.c 并将其提交到存储库。
- 我正在将分支文件 Foo.c 移动到 Bar.c 并将其提交到存储库。
合并开发人员 A 对我的分支工作副本的更改会导致树冲突:
- Bar.c 已经在我的工作副本中,状态为“正常”
- Foo.c 被标记为缺失,并出现树冲突
在大多数情况下,我需要合并开发人员A 将 Foo.c 更改为重命名的 Bar.c。
但我该怎么办呢?
包含开发人员 A 更改的文件 Foo.c 不存在于我的分支 WC 中。
TortoiseSVN 帮助说“请注意,如果您从存储库复制丢失的文件,然后标记为已解决,您的副本将再次被删除。你必须先解决冲突。”
那么,我是否需要 chechout trunk 才能访问 Foo.c 文件进行合并?有没有更简单的方法来解决这个问题?
这个问题(TortoiseSVN 如何解决树冲突)对于我和我们的开发人员来说非常关键。
你能帮我吗?
TortoiseSVN can help with several kinds of tree conflicts using Edit Conflict window.
The problem is that in case of "... upon merge" conflict types TortoiseSVN can't guess which files need to be merged.
For example, (case: local missing, incoming delete upon update)
- Developer A working on trunk modifies file Foo.c and commits it to the repository.
- I working on branch move file Foo.c to Bar.c and commit it to the repository.
A merge of developer A's changes to my branch working copy results in a tree conflict:
- Bar.c is already in my working copy with status 'normal'
- Foo.c is marked as missing with a tree conflict
In most cases I need to merge Developer A’s changes to Foo.c into the renamed Bar.c.
But how can I do it?
File Foo.c with Developer A’s changes does not present in my branch WC.
The TortoiseSVN Help says “Note that if you copy the missing file from the repository and then mark as resolved, your copy will be removed again. You have to resolve the conflict first.”
So, should I need to chechout trunk to have access to Foo.c file for merge? Is there more simple approach to solve this problem?
This problem (how TortoiseSVN can solve tree conflicts) is very critical for me and our developers.
Could you help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我喜欢泽勒斯的解决方案。您还可以将文件的移动合并到分支中,然后执行合并回主干。
我在合并大分支时所做的就是先将主干合并到分支中,解决所有冲突(包括树冲突),然后将结果合并回主干。这也使主干在合并期间保持更长时间的稳定。
I like zellus's solution. You could also merge the move of the file into the branch, and then perform the merge back to trunk.
What I do when merging big branches, is merge trunk into the branch first, resolve all the conflicts (including tree conflicts), then merge the result back to trunk. This keeps trunk more stable for longer during the merge period, too.
您可以使用“两个 URL 合并”将“主干”上
Foo.c
的更改合并到分支并重命名为Bar.c
中。而 Branch/B 是工作副本。
为了最终消除冲突,开发人员 A 和 B 应该就相同的文件名达成一致。对于相同的代码使用不同的文件可能并不理想。
编辑:
通过研究“其他”风险投资公司如何解决这个问题,我想 引用段落“重命名文件并合并更改”:
也许是一个尝试 Mercurial 的理由。
You may use a "Two URL Merge" in order to merge changes from
Foo.c
on 'trunk' into your branched and renamedBar.c
.Whereas branch/B is a working copy.
To finally remove the conflict developer A and B should agree on the same filename. Using different files for the same code might not be desirable.
EDIT:
From looking at how 'other' vcs approach this issue, I would like to quote from the paragraph 'Renaming files and merging changes':
Maybe a reason to give Mercurial a try.