4492
Comment:
|
4743
gardening
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
As of Launchpad 2.1.12, Launchpad now supports creating merge proposals using bzr send. | Launchpad supports creating merge proposals using bzr send. |
Line 21: | Line 21: |
In bazaar.conf, add an entry to your aliases: | Please ensure the lpreview_body plugin is installed: |
Line 23: | Line 23: |
[ALIASES] lpsend=send --no-bundle |
bzr branch lp:~launchpad/lpreview-body/trunk/ ~/.bazaar/plugins/lpreview_body |
Line 27: | Line 26: |
= Client configuration = Due to bug [[https://bugs.edge.launchpad.net/bzr/+bug/291847 | #291847]], it is necessary to specify your mail client on Intrepid. Possible values include: evolution, kmail, thunderbird, emacsclient, mutt |
= Mail client = |
Line 32: | Line 28: |
If your client is not supported, you can use "editor". | You should configure Bazaar to use a mail client that has support for message bodies: evolution, thunderbird, or editor. If your mail client is not in this list, use "xdg-email". Due to an unfortunate oversight, "default" does not claim to support message bodies in bzr 1.15. (Patches to improve Bazaar's mail client support are welcome, of course.) |
Line 34: | Line 30: |
e.g. | For example, if you wish to use xdg-email, add the following to ~/.bazaar/bazaar.conf: |
Line 36: | Line 32: |
[DEFAULT] mail_client = thunderbird |
mail_client = xdg-email |
Line 39: | Line 34: |
== Claws == Bazaar's support for Claws is via xdg-utils, which is broken in Intrepid (see above). However, there is a tiny plugin that will will provide direct support for Claws: {{{ cd ~/.bazaar/plugins bzr branch lp:~allenap/+junk/bzr-claws claws }}} Don't forget to set `mail_client` to `claws` too. This also fixes a small annoyance when using xdg-utils with Claws. If you ask xdg-email to attach a file to the email, Claws will pop up a modal dialog box to confirm that a file has indeed been attached. |
|
Line 59: | Line 40: |
bzr push; bzr lpsend | bzr send |
Line 62: | Line 43: |
This will create a merge proposal and a diff and place them in your preferred email client to polish off and send to Launchpad. The body of your message will be used as the initial comment. | This will create a merge directive containing a diff and a bundle, and place them in your preferred email client to polish off and send to Launchpad. The lpreview_body plugin will pre-populate the message body with our standard template, plus lint output. |
Line 64: | Line 45: |
This example uses the lpsend alias, to ensure you specify --no-bundle. If you forget to supply --no-bundle, bzr send will not verify that your public branch is up-to-date. (Bundle support for Launchpad is coming soon.) | Next, you edit and send the message. When Launchpad receives the message, it will use the bundle to create a branch on Launchpad, and then propose it for merging. Launchpad will use the body of your message as the initial comment of the merge proposal. = Claws support = The default mail client support via xdg-utils should be used at present, because Bazaar's direct support for Claws has not yet been updated to work with the lpreview_body plugin. It is a known issue that xdg-utils causes a modal dialog box to confirm that a file has been attached. |
Line 74: | Line 61: |
bzr lpsend -r 1234..1239 | bzr send -r 1234..1239 |
Line 85: | Line 72: |
bzr lpsend -r thread:..-1 | bzr send -r thread:..-1 :submit lp:~`bzr launchpad-login --no-check`/launchpad/`bzr nick` |
Line 88: | Line 75: |
This will push a branch to Launchpad with the branch name being the thread name. | |
Line 91: | Line 79: |
'''Answer:''' No, dependent branches are not currently supported for merge proposals. We do expect to resurrect the feature at some point, but it was much faster to start with the simple case. | '''Answer:''' No. bzr send's model is that you propose merging a particular change, so dependent branches are incompatible with that model. We do expect to resurrect the feature at some point, but it will only work in the web UI. |
Line 96: | Line 84: |
'''Answer:''' Not yet, but this is a planned feature. However, if you receive an email about the merge proposal being created, it will include the diff as an attachment. | '''Answer:''' Yes, on the merge proposal page right click the green link next to "Diff against target" and then "save as". Simply clicking the link will scroll to the diff in the browser. |
Line 98: | Line 86: |
'''Question:''' What URLs are recognized? |
'''Question:''' What URLs are recognized by bzr send? |
Line 102: | Line 89: |
'''Question:''' How does lpreview_body decide whether to provide a body? '''Answer:''' The target branch must match this regex: {{{bzr\+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/(db-)?devel}}} |
|
Line 106: | Line 97: |
'''Answer:''' Yes. Launchpad will create !RemoteBranch for the source branch if the source is not represented on Launchpad. However, the target branch must be known to Launchpad. '''Question:''' Should I use the --no-patch option to bzr send? '''Answer:''' No. Launchpad uses that patch verbatim. If it's not present, LP cannot show a diff. |
'''Answer:''' Yes. Launchpad will create a !RemoteBranch for the source branch if the source is not represented on Launchpad. However, the target branch must be known to Launchpad. |
Line 117: | Line 103: |
'''Question:''' Creating a new merge proposal via the web no longer creates multiple emails. Why does creating a new merge proposal via {{{bzr send}}} create multiple emails? | '''Question:''' What if I use web mail? |
Line 119: | Line 105: |
'''Answer:''' The API for sending a single email is not quite in sync with merge-proposal-by-email's needs. This is coming soon. | '''Answer:''' You can use the "editor" mail client. '''Question:''' Will we be reinstating the lpreview plugin using the bzr send stuff? '''Answer:''' No. the lpreview-body plugin is a replacement for that functionality. |
Launchpad supports creating merge proposals using bzr send.
One-time set-up
Please make sure you have your public and submit branches set properly. Below is an example ~/.bazaar/locations.conf
[/home/rockstar/Projects/launchpad/] submit_branch = /home/rockstar/Projects/launchpad/trunk push_location = bzr+ssh://bazaar.launchpad.net/~rockstar/launchpad/ push_location:policy = appendpath public_branch = bzr+ssh://bazaar.launchpad.net/~rockstar/launchpad/ public_branch:policy = appendpath submit_to = merge@code.launchpad.net [/home/rockstar/Projects/launchpad/trunk] public_branch = bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/devel
Please ensure the lpreview_body plugin is installed:
bzr branch lp:~launchpad/lpreview-body/trunk/ ~/.bazaar/plugins/lpreview_body
Mail client
You should configure Bazaar to use a mail client that has support for message bodies: evolution, thunderbird, or editor. If your mail client is not in this list, use "xdg-email". Due to an unfortunate oversight, "default" does not claim to support message bodies in bzr 1.15. (Patches to improve Bazaar's mail client support are welcome, of course.)
For example, if you wish to use xdg-email, add the following to ~/.bazaar/bazaar.conf:
mail_client = xdg-email
Creating a New Merge Proposal
Once your environment is set up, bzr send is as easy as
bzr send
This will create a merge directive containing a diff and a bundle, and place them in your preferred email client to polish off and send to Launchpad. The lpreview_body plugin will pre-populate the message body with our standard template, plus lint output.
Next, you edit and send the message.
When Launchpad receives the message, it will use the bundle to create a branch on Launchpad, and then propose it for merging. Launchpad will use the body of your message as the initial comment of the merge proposal.
Claws support
The default mail client support via xdg-utils should be used at present, because Bazaar's direct support for Claws has not yet been updated to work with the lpreview_body plugin. It is a known issue that xdg-utils causes a modal dialog box to confirm that a file has been attached.
Frequently Asked Questions
Question: How do I specify revisions to generate the diff from?
Answer:When doing bzr submit, you may want to only generate a diff from a range of revisions. You can use -r parameter to specify the range, as below:
bzr send -r 1234..1239
This will generate a diff from revno 1234 to 1239.
Question: Does this work with looms?
Answer: Launchpad's Loom support needs some work, and this doesn't make it better or worse. However, you can specify a diff between threads by doing
bzr send -r thread:..-1 :submit lp:~`bzr launchpad-login --no-check`/launchpad/`bzr nick`
This will push a branch to Launchpad with the branch name being the thread name.
Question: Does this handle dependent branches?
Answer: No. bzr send's model is that you propose merging a particular change, so dependent branches are incompatible with that model. We do expect to resurrect the feature at some point, but it will only work in the web UI.
Question: Can I download the diff from the merge proposal in the web UI?
Answer: Yes, on the merge proposal page right click the green link next to "Diff against target" and then "save as". Simply clicking the link will scroll to the diff in the browser.
Question: What URLs are recognized by bzr send?
Answer: lp:, bzr+ssh:, sftp: and http: are all recognized. Remote URLs for Remote Branches and Mirrored Branches will work. Decorated versions, such as nosmart+bzr+ssh: will not work.
Question: How does lpreview_body decide whether to provide a body?
Answer: The target branch must match this regex: bzr\+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/(db-)?devel
Question: Can I submit a branch that is not hosted on Launchpad?
Answer: Yes. Launchpad will create a RemoteBranch for the source branch if the source is not represented on Launchpad. However, the target branch must be known to Launchpad.
Question: What if I want to use my editor, like review-submit did?
Answer: You can configure Bazaar to use the "editor" mail client.
Question: What if I use web mail?
Answer: You can use the "editor" mail client.
Question: Will we be reinstating the lpreview plugin using the bzr send stuff?
Answer: No. the lpreview-body plugin is a replacement for that functionality.