How can I copy an existing merge proposal to a backports project?

Created by Stefan Rijnhart (Opener)
Keywords:
Last updated by:
Stefan Rijnhart (Opener)

What you need is an existing merge proposal for an OpenERP project (server, addons or web). This may well be a proposal for your own contributed bugfix, or an OPW branch.

Make sure that a bug report is associated with the original branch. In the case of an OPW issue there may not be. Without a bug report we cannot track whether a fix is supposedly fixed where and when. If there is no bug report associated with the branch, search for an existing bug report or create a new one if there isn't. Associate the original branch with the bug by clicking 'Link a bug report' on the branch page.

Associate the bug with the appropriate backport project, by clicking 'Also affects project'. Also assign the exact series of the backport project to the bug report by clicking 'Assign to series'. Assign yourself as the user responsible for this bug with respect to the backport project by clicking 'Assigned to' and then 'Assign me'.

The next step is to duplicate the bugfixing branch and the merge request on the backport project. Due to limitations of Launchpad and bzr you cannot propose cross-project merges through Launchpad. You'll therefore have to duplicate the branch on the corresponding backports project and propose a merge of this duplicated branch. There are two ways of doing so:

1: manually. Branch a copy of the backport project and cherry pick the original bug fixing branch. Remember to attribute the changes correctly, using the '--author' switch. Push the branch and propose it. Refer to the original branch in the proposal description.

2: using the clone script. In https://code.launchpad.net/~therp-nl/lp-community-utils/replaybot_clone_mp_to_community, you find a set of scripts. Use clone_mp_to_community.py to duplicate both the bugfixing branch and the original merge proposal:

clone_mp_to_community.py \
    -c ocb-server-7.0 \
    --mp-url https://code.launchpad.net/~mmakonnen/openobject-server/70_am_translation/+merge/141309

Parameter '--mp_url': this is a link to the merge proposal that needs to be cloned. Proposals will be cloned on the correct backport project automatically.

Parameter '-c': supplying a local branch of the target saves the script from having to download a copy from Launchpad. You can reuse this copy. This branch may not reside in a shared repository.

Note that the script works on a copy the target branch so you will need a little space in your system tmp directory. The copy is cleaned up automatically, unless you interrupt the script.