helper: Use the correct head when merging a patch
Fixes a bug where the wrong head would be used as part of the merge action.
Use the head of the revision instead of the head of the canonical branch.
Fixes a bug where the wrong head would be used as part of the merge action.
Use the head of the revision instead of the head of the canonical branch.
Improve tests.
Improve tests.