Diff for "Code/BzrSend"

Not logged in - Log In / Register

Differences between revisions 1 and 28 (spanning 27 versions)
Revision 1 as of 2008-12-17 20:14:51
Size: 1855
Editor: rockstar
Comment:
Revision 28 as of 2011-07-15 13:23:18
Size: 4910
Editor: bac
Comment:
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. = This tool is deprecated =
Line 3: Line 3:
= Prerequisites = Please use {{{bzr lp-propose}}} as described in this [[https://lists.launchpad.net/launchpad-dev/msg06026.html|email]] from abently.

Launchpad supports creating merge proposals using bzr send.

= One-time set-up =
Line 9: Line 13:
submit_branch = lp:~launchpad-pqm/launchpad/devel
push_location = lp:~rockstar/launchpad/
submit_branch = /home/rockstar/Projects/launchpad/trunk
push_location = bzr+ssh://bazaar.launchpad.net/~rockstar/launchpad/
Line 12: Line 16:
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
Line 14: Line 25:
A few things to note: the branch locations are specified with with lp: (as opposed to the path lp: resolves to). Launchpad must know about the source branch from the merge proposal (meaning it has to be registered on Launchpad). If Launchpad doesn't know about the target branch, it will create a remote branch for it. Please ensure the lpreview_body plugin is installed:
{{{
bzr branch lp:~launchpad/lpreview-body/trunk/ ~/.bazaar/plugins/lpreview_body
}}}
Line 16: Line 30:
It's also recommended that you tell bazaar about your mail client in ~/.bazaar/bazaar.conf = Mail client =
Line 18: Line 32:
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:
Line 19: Line 36:
[DEFAULT]
mail_client = thunderbird
mail_client = xdg-email
Line 28: Line 44:
bzr send --no-bundles --mail-to merge@code.launchpad.net bzr send
Line 31: Line 47:
You'll want to specify --no-bundles so that bzr checks to make sure your public branch has all the revisions of your local branch. You can also tell bzr where to send emails in your ~/.bazaar/locations.conf Following along from the example above, the file snippet would read: 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:
Line 34: Line 65:
[/home/rockstar/Projects/launchpad/]
submit_branch = lp:~launchpad-pqm/launchpad/devel
push_location = lp:~rockstar/launchpad/
push_location:policy = appendpath
submit_to = merge@code.launchpad.net
}}}

=== Specifying revisions ===

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 -no-bundles --mail-to merge@code.launchpad.net -r 1234..1239
bzr send -r 1234..1239
Line 50: Line 69:


'''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.

This tool is deprecated

Please use bzr lp-propose as described in this email from abently.

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.

Code/BzrSend (last edited 2011-07-15 13:23:18 by bac)