Sometimes through weird circumstances we can end up with Git repositories where merges between a commit and an ancestor to that commit. Converting such a commit to Mercurial can be tricky, and in one case we are currently failing.
The GitToHgConverter is already trying to solve this issue, but only detects the ancestor relationship in one direction between the commits to be merged, and not the other. Specifically if the first parent is an ancestor of the second parent, the conversion will identify the situation and apply the workaround. But, if instead the second parent is an ancestor of first parent, it's not detected. The first case is quite commonly achieved by merging in a branch using --no-ff, but the second seems rarer.
I think the same workaround can be applied regardless of the direction of this relationship and that should solve the issue we are currently facing with one of our conversion jobs.
The GitToHgConverter is already trying to solve this issue, but only detects the ancestor relationship in one direction between the commits to be merged, and not the other. Specifically if the first parent is an ancestor of the second parent, the conversion will identify the situation and apply the workaround. But, if instead the second parent is an ancestor of first parent, it's not detected. The first case is quite commonly achieved by merging in a branch using --no-ff, but the second seems rarer.
I think the same workaround can be applied regardless of the direction of this relationship and that should solve the issue we are currently facing with one of our conversion jobs.