Mercurial automatic merge

蹲街弑〆低调 提交于 2019-12-12 03:37:33

问题


I'm a newbie in using mercurial and control version system in general,
I know that:

  • There exists a Central Remote repository
  • Everybody has a local repository, obtained by cloning the central one creating a branch
  • Everyone makes changes to a working space area, these changes are then committed to the local repository.
  • After changes have been performed locally, they are merged with the centralized repository or the centralized repository is overwritten by means of a rebasing

In mercurial when we make a pull and two conditions hold:

  • the central repository has been changed since we made the last pull.
  • we updated our local repository since the last pull.

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.


回答1:


  1. Your workflow is just terrible, your mercurial-lingo is dirty
  2. Read hg help merge

... 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.

But BEWARE:

Rebase uses repeated merging to graft changesets from one part of history (the source) onto another (the destination).

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)



来源:https://stackoverflow.com/questions/31772077/mercurial-automatic-merge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!