问题
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:
- Your workflow is just terrible, your mercurial-lingo is dirty
- 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