fold: allow folding merge commits in a way that avoids issue6332
We don't create a merge where one of the parent is an ancestor of the other parent: in such case, we just take the last parent and turn the merge commit into a regular commit (with one parent). --HG-- branch : stable