UbuntuWiki:UsingBZR

来自Ubuntu中文
跳到导航跳到搜索

{{#ifexist: :UbuntuWiki:UsingBZR/zh | | {{#ifexist: UbuntuWiki:UsingBZR/zh | | {{#ifeq: {{#titleparts:UbuntuWiki:UsingBZR|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:UbuntuWiki:UsingBZR|1|-1|}} | zh | | }}

Six steps to using bzr

To collaborate more effectively on source packages, it would be wise to push your packages to the bzr repository. Now, as long as in your package you specify a link to the .orig tarball, then all you need to push is your debian/ sub-directory, containing the package source. I will outline how to do this. You must have your SSH key published in Launchpad, but that is beyond the scope of this document.

1. cd to your package source directory

  • For instance, I may run, `cd ~/src/ubuntustudio/somalist`.

2. Initialise the bzr repository.

  • `bzr init`

3. Add the debian sub-directory to the repository.

  • `bzr add debian`

4. I guess you would like to commit this change. This is the command to run when you want to commit any change.

  • `bzr commit -m "commit comment"`
  • Of course, I'm sure you want a different comment than 'commit comment'.

5. To see a diff between revisions, run

  • `bzr diff`
  • This is useful to run before every commit, to see exactly what changes are about to be committed.

6. Now push the repository out to Launchpad!

  • `bzr push sftp://<lp-name>@bazaar.launchpad.net/~<lp-owner>/<product>/<branch-name>`
      • `lp-name` is your Launchpad ID; i.e. mine would be `tsmithe`
      • `branch-name` is the name of the branch that you wish to create. We have decided that this should happen per package. So, in my example case, the branch-name is 'somalist'.
      • `product` is the Launchpad-registered product that you are working on.
      • `lp-owner` is the person whose branch we are developing on. You can have a team branch (e.g. `ubuntustudio-dev`) that the whole team may work on, or your own branch (in which case the `lp-owner` is your `lp-name`) that you only can push to and that can be used to maintain your own copy of the sources, which you can later merge into the main branch (owned by the team), say; or that others can pull from.
  • In future pushes, bzr will remember the location of the repository to push to for this local branch. So you can then just run `bzr push`.

That's it! You've pushed your code out! Now you can do version control, revert mistakes, collaborate, or merge changes from another branch. Simple!

Remember, `man bzr` is a good reference.


This page was taken and modified slightly to generalise from UbuntuStudio/bzr