Imagine this scenario:
- Alice and Bob both clone a central Mercurial repository containing 1 text file
- Both Alice and Bob make changes to the same line in the file and commit
- Bob returns to the central repository, but not Alice
- Alice is now pulled into her repository, notices that she now has two heads, and merges.
- Since merging is a conflict, it resolves the conflict
- Alice then commits but does not press
- Bob now makes changes to the file, in another place of the file (i.e. nowhere near the initial changes) and does not perform any actions, and also pushes
- Alice in her combined file makes a similar change in the same place when Bob just changed, and commits
- Alice pulls and opens another two-headed repository, she merges
Here's a different look at the above scenario
(the numbers after "CHANGE" mean that the person has changed the "part X" of the file. If both users have changed the same part, we have a merge conflict in front, if they changed differently, not so much)
Alice bob
CLONE MASTER CLONE MASTER
-----------------------------------------
CHANGE 1 <----- +
COMMIT + - upcoming merge conflict
----------------------------------------- |
CHANGE 1 <----- +
COMMIT
PUSH
-----------------------------------------
PULL <-- Bob change +1 head
MERGE <-- Attempt to get rid of extra head
RESOLVE CONFLICT <-- Resolve merge conflict
COMMIT
-----------------------------------------
CHANGE 2 <-----+
COMMIT +-- yet another merge
PUSH | conflict ahead
----------------------------------------- |
CHANGE 2 <-----+
COMMIT
PULL <-- Bob change, again +1 head
MERGE <-- Attempt to get rid of extra head
RESOLVE ???
:
-, , .
, , , ?
( , - script )), Mercurial .
, Mercurial diff/merge? - ? , Beyond Compare, ( + ) ? , Beyond Compare, ( , ).