简体   繁体   English

与Mercurial合并同一文件

[英]merging same file with mercurial

Ok so I've done a lot off reading and watching of videos but I am still struggling with merging and how its handled i am currently using sourcetree and commandline for most of my testing. 好的,所以我在阅读和观看视频方面做了大量工作,但是我仍在努力进行合并以及合并的处理方式,我目前大多数测试都使用sourcetree和commandline。

So the question is when two users edit the same file but the edits conflict how is that conflict resolved and how does the repository handle it (it seems to accept both edits and leaves it up to the admit to resolve) 所以问题是,当两个用户编辑同一文件但编辑冲突时,如何解决该冲突以及存储库如何处理该文件(似乎接受两个编辑并将其留待承认解决)

Just to give an example 仅举一个例子

Numbers.txt(original) Numbers.txt(原始)

line 1: 1,2,3,4,5

Numbers.txt(edit1) Numbers.txt(edit1)

line 1: 1.0,2.0,3.0,4.0,5.0

Numbers.txt(edit2) Numbers.txt(edit2)

line 1: 1.00,2.00,3.00,4.00,5.00

so how is this conflict resolved through mercurial or the GUI sourcetree? 那么如何通过Merurial或GUI Sourcetree解决此冲突?

how is this conflict resolved through mercurial or the GUI sourcetree? 如何通过Mercurial或GUI Sourcetree解决此冲突?

By hand, with user choice and intervention 手动,由用户选择和干预

When both changes will be collected in some common repository, this repository will have two independent heads with common parent (and diverged history). 当两个更改都将收集在某个公用存储库中时,该存储库将有两个独立的负责人,并具有共同的父级(以及不同的历史记录)。

At merge heads stage (back to single head) conflict will be detected and merge-master must to make choice, what to have in merge-result 在合并负责人阶段(返回到单个负责人),将检测到冲突,并且合并主管必须做出选择,合并结果中应包含的内容

HTH 高温超导

This conflict is not resolved by the Mercurial Merge engine. Mercurial Merge引擎无法解决此冲突。

  • The first user that commit's his work has the easy job. 提交工作的第一个用户就很轻松。
  • The second user has the job to merge both versions, possibly contacting the first user. 第二个用户有合并两个版本的工作,可能会与第一个用户联系。

When the second user has finished merging, then he can commit and the job is done. 当第二个用户完成合并后,他可以提交并完成工作。

Advise: make sure you are the first to commit! 忠告:确保您是第一个承诺的人!

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

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