diff --git a/forwardport/models/project.py b/forwardport/models/project.py index f5d48ae1..d7825b7c 100644 --- a/forwardport/models/project.py +++ b/forwardport/models/project.py @@ -605,8 +605,7 @@ More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port working_copy.checkout('-bsquashed', root_branch) root_commits = root.commits() - # squash to a single commit: reset to the first parent of the pr's - # first commit + # squash to a single commit working_copy.reset('--soft', root_commits[0]['parents'][0]['sha']) working_copy.commit(a=True, message="temp") squashed = working_copy.stdout().rev_parse('HEAD').stdout.strip().decode() @@ -616,9 +615,15 @@ More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port # cherry-pick the squashed commit working_copy.with_params('merge.renamelimit=0').with_config(check=False).cherry_pick(squashed) - working_copy.commit( - a=True, allow_empty=True, - message="""Cherry pick of %s failed + # if there was a single commit, reuse its message when committing + # the conflict + # TODO: still add conflict information to this? + if len(root_commits) == 1: + working_copy.commit(all=True, allow_empty=True, reuse_message=root_commits[0]['sha']) + else: + working_copy.commit( + all=True, allow_empty=True, + message="""Cherry pick of %s failed stdout: %s