Diff for "Code/BzrSend"

Not logged in - Log In / Register

Differences between revisions 1 and 8 (spanning 7 versions)
Revision 1 as of 2008-12-17 20:14:51
Size: 1855
Editor: rockstar
Comment:
Revision 8 as of 2008-12-17 22:32:51
Size: 3205
Editor: abentley
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
= Prerequisites = = One-time set-up =
Line 9: Line 9:
submit_branch = lp:~launchpad-pqm/launchpad/devel
push_location = lp:~rockstar/launchpad/
submit_branch = bzr+ssh://bazaar.launchpad.net/~path-to/launchpad/trunk
push_location = bzr+ssh://bazaar.launchpad.net/~rockstar/launchpad/
Line 12: Line 12:
public_location = bzr+ssh://bazaar.launchpad.net/~rockstar/launchpad/
public_location:policy = appendpath
submit_to = merge@code.launchpad.net
Line 14: Line 17:
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. In bazaar.conf, add an entry to your aliases:
{{{
[ALIASES]
lpsend=send --no-bundle
}}}
Line 16: Line 23:
It's also recommended that you tell bazaar about your mail client in ~/.bazaar/bazaar.conf '''For thunderbird users:''' It's recommended that you tell bazaar about your mail client in ~/.bazaar/bazaar.conf
Line 28: Line 35:
bzr send --no-bundles --mail-to merge@code.launchpad.net bzr lpsend
Line 31: Line 38:
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 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 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.)


== 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 50:
[/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 lpsend -r 1234..1239
Line 50: Line 54:


'''Question:''' Does this work with looms?

'''Answer:''' Launchpad's Loom support needs some work, and this doesn't make it better or worse. You can specify a diff between threads by doing

{{{
bzr lpsend -r thread:..-1
}}}


'''Question:''' Does this handle dependent branches.

'''Answer:''' No, dependent branches are not currently supported for merge proposals. We do expect to resurrect the feature at some point.


'''Question:''' Can I download the diff from the merge proposal in the web UI?

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


'''Question:''' What URLs are recognized?

'''Answer:''' lp:, bzr+ssh:, sftp: and http: are all recognized. Remote URLs for Remote Branches and Mirrored Branches will work.


'''Question:''' Can I submit a branch that is not hosted on Launchpad?

'''Answer:''' Yes. As long as the target branch is represented on Launchpad, it will create RemoteBranch for the source branch if the source is not a Launchpad branch.


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


'''Question:''' What if I want to use my editor, like review-submit did?

'''Answer:''' You can configure Bazaar to use the "editor" mail client.

As of Launchpad 2.1.12, Launchpad now 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 = bzr+ssh://bazaar.launchpad.net/~path-to/launchpad/trunk
push_location = bzr+ssh://bazaar.launchpad.net/~rockstar/launchpad/
push_location:policy = appendpath
public_location = bzr+ssh://bazaar.launchpad.net/~rockstar/launchpad/
public_location:policy = appendpath
submit_to = merge@code.launchpad.net

In bazaar.conf, add an entry to your aliases:

[ALIASES]
lpsend=send --no-bundle

For thunderbird users: It's recommended that you tell bazaar about your mail client in ~/.bazaar/bazaar.conf

[DEFAULT]
mail_client = thunderbird

Creating a New Merge Proposal

Once your environment is set up, bzr send is as easy as

bzr lpsend

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

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 lpsend -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. You can specify a diff between threads by doing

bzr lpsend -r thread:..-1

Question: Does this handle dependent branches.

Answer: No, dependent branches are not currently supported for merge proposals. We do expect to resurrect the feature at some point.

Question: Can I download the diff from the merge proposal in the web UI?

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.

Question: What URLs are recognized?

Answer: lp:, bzr+ssh:, sftp: and http: are all recognized. Remote URLs for Remote Branches and Mirrored Branches will work.

Question: Can I submit a branch that is not hosted on Launchpad?

Answer: Yes. As long as the target branch is represented on Launchpad, it will create RemoteBranch for the source branch if the source is not a Launchpad branch.

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.

Question: What if I want to use my editor, like review-submit did?

Answer: You can configure Bazaar to use the "editor" mail client.

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