Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which merge strategies does mercurial use?

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?

like image 658
hawkeye Avatar asked Nov 27 '09 23:11

hawkeye


People also ask

How do I merge Mercurials?

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.

What is the best merge strategy?

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.

How do you merge Heads in Mercurial?

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.


1 Answers

  • already up-to-date
  • fast-forward

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

  • octopus

Doesn't apply to mercurial, merges are always between two heads.

  • resolve

That's the default merge strategies.

  • recursive

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.

like image 56
tonfa Avatar answered Oct 22 '22 05:10

tonfa