PatchMergeRequests

Converting a patch into a merge request

If a patch applies to a project maintained in Launchpad, you can create a code branch with the patch applied and request that it is merged into the project's Trunk branch. Merge requests can save time for project maintainers as they do not have to manually apply the patch themselves.

Walkthrough

  • Check if the bug's Upstream project is maintained in Launchpad. You can use the Launchpad project search to help you.

  • If it is maintained in Launchpad use BZR to download the projects Trunk code branch. For example to download Gwibber's trunk run

bzr branch lp:gwibber
  • Download the patch and apply it in the directory you just downloaded

cd gwibber
wget https://www.launchpadlibrarian.net/gwibber.patch
patch -p0 < gwibber.patch
  • Commit the new code to the branch with a message describing what the patch fixes/implements. Use the --fixes lp:xxxxx argument to automatically link the bug report to your branch.

bzr commit -m "Apply patch to fix segfaults" --fixes lp:60833
  • We can now push the code onto Launchpad. Launchpad will automatically register a new branch when you push your new code. The location to push to follows this format lp:~username/project/name-of-branch. The name of the branch should describe the fix, commonly just the bug number is used:

bzr push lp:~bobbo/gwibber/bug60833
  • Now we file a merge request. You can request a merge by visiting https://code.launchpad.net/~username/project/branchname/ (alternatively use the command bzr lp-open in the branch directory to automatically open the page) and clicking on "Propose for merging". You will normally want to merge into the main branch, which is marked a "development focus" on the merge request page. You should try to give a detailed description of what changes the patch makes and at some point mention the bug number (however, your branch should be automatically linked to the bug report if you used the --fixes argument when committing). Click on "Propose Merge" to submit the merge request.

  • You should add a comment to the bug report explaining you have requested a merge and link to the request page.

More Information

ReviewersTeam/PatchMergeRequests (last edited 2010-06-07 15:29:16 by cpc4-sgyl21-0-0-cust119)