I work in an environment with large scale multi-parallel branching. Looking at GIT I see it has several merge strategies:
already up-to-date
fast-forward
octopus
resolve
recursive
Does Mercurial have the equivalent of each of these? (ie is the implementation of Mercurial's merge algorithm as good as recursive?
To merge two branches, you pull their heads into the same repository, update to one of them and merge the other, and then commit the result once you're happy with the merge. The resulting changeset has two parents.
The most commonly used strategies are Fast Forward Merge and Recursive Merge. In this most commonly used merge strategy, history is just one straight line. When you create a branch, make some commits in that branch, the time you're ready to merge, there is no new merge on the master.
To start a merge between the two heads, we use the hg merge command. We resolve the contents of hello. c This updates the working directory so that it contains changes from both heads, which is reflected in both the output of hg parents and the contents of hello.
Those aren't merge strategies, I guess the first one is when there's nothing to merge (obviously supported). The second isn't a merge, updating in hg is equivalent to fast-forward (there's nothing to merge).
Doesn't apply to mercurial, merges are always between two heads.
That's the default merge strategies.
Could probably be done with a custom merge script (hg
, like git
just call external tools to handle the merge). But nobody seemed interested in it for now, maybe because it doesn't bring a lot of improvements compared to resolve.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With