水银自动合并 [英] Mercurial automatic merge
问题描述
我是一般使用水银版和控制版系统的新手,
我知道:
I'm a newbie in using mercurial and control version system in general,
I know that:
- 存在一个中央远程存储库
- 每个人都有一个本地存储库,可以通过克隆中央存储库来创建分支
- 每个人都对工作空间区域进行更改,然后将这些更改提交到本地存储库.
- 在本地执行更改后,将它们与集中式存储库合并,或者通过重新设置基准将集中式存储库覆盖
在拉力和两个条件成立的情况下:
In mercurial when we make a pull and two conditions hold:
- 自从上次提取以来,中央存储库已更改.
- 自上次拉取以来,我们更新了本地存储库.
本地存储库中发生合并.
Mercurial有时要我进行手动合并,而另一些时候该合并是自动进行的,我想知道在什么情况下会发生这种情况.
A merge occurs in the local repository.
Mercurial sometimes wants me to make a manual merge, some other times the merge is managed automatically,I would like to know in what situation this happens.
推荐答案
- 您的工作流程非常糟糕,您的语言措辞很肮脏
- 阅读
hg help merge
...成功返回0,如果有未解决的文件,则返回1
... Returns 0 on success, 1 if there are unresolved files
通过检查此退出代码,您始终可以知道(甚至是无人看管的)合并结果并执行所需的操作.
by checking this exit-code you can always know results of (even unattended) merge and perform needed operations.
但是注意:
Rebase使用重复合并来嫁接来自其中一部分的变更集 历史(源)转移到另一个(目标)上.
Rebase uses repeated merging to graft changesets from one part of history (the source) onto another (the destination).
因此-如果您在合并时使用退出代码1,则很可能也会在重新设置基础上发生合并冲突(无论如何也需要手动操作)
thus - if you have exit-code 1 on merge, you, most probably, will get merge-conflict also on rebase (and the need of handwork anyway)
这篇关于水银自动合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!