HowToUseBzr

From AWN Wiki

Jump to: navigation, search

Bazaar is a decentralized revision control system used by AWN's developers and many others, primarily on Launchpad. Revision control involves keeping track of changes in software source code, and often encouraging team-based collaboration.

To learn about Bazaar on the command-line:

   $ bzr help

To learn about Bazaar commands:

   $ bzr help commands

[edit] Using Bazaar with Launchpad

This will explain how to take changes you have made and commit them to the Launchpad code repository. First, make sure you have completed the steps outlined in HowToDevelopWithLaunchpad.

1. Download a fresh branch (which is different from a checkout). Using the trunk of awn-extras as an example (to find the proper URL, visit the "code" tab of the project and select the desired branch; the information will be listed next to "Download URL").

bzr branch http://bazaar.launchpad.net/~awn-extras/awn-extras/trunk awn-extras

2. Apply any patches and/or make any changes.

3. Commit to your local branch. If you are pushing to a "trunk", or especially a stable branch, please make sure your changes have been tested by others.

bzr commit

4. You should be prompted for your log message. Make sure the first line is the name of the applet/project you are working on, followed by a list of changes for it. For example (note that Launchpad will auto-link to bugs):

BlingSwitcher:
 * applied patch from bug #159025 to fix going from first to last
   viewport via mousewheel

5. Save the file (the name should be pre-filled; even though it looks like gibberish, it is the proper filename), and close. Your changes should be committed.

6. In the time between when you branched the repository and when you are ready to push your changes to the remote branch, there may have been some changes in the remote branch. In order for your changes to push cleanly, you need to merge the changes from upstream. Run the following:

bzr merge

Make a note of the revision number of the remote branch from which you're merging. You'll need it later. If the command's output states that there are conflicts, don't panic. Bazaar's user guide has a section on handling conflicts.

Once there are no more conflicts, you need to commit this merge into your local branch. Follow steps 3 through 5 again. A good commit message for a merge looks like this:

Merge from [branch name], revision [revision]

where [branch name] is the name of the remote branch, and [revision] is the revision number that you noted earlier.

7. Now it is finally time to push your changes onto Launchpad, which will take your local branch commit and make the changes live. This full command is available on the Launchpad code page of the desired branch. Again, assuming awn-extras trunk (and you have access to commit to this branch):

bzr push bzr+ssh://<name>@bazaar.launchpad.net/~awn-extras/awn-extras/trunk

8. Assuming all went well, your changes are now in the current revision, which has incremented by one, and will be downloaded by anyone doing a checkout or branch!

[edit] External Links

Personal tools