Working with Bazaar
WARNING: lp:inkscape is currently out of date. Do not use it until the migration to Launchpad is complete.
First you need to tell Bazaar your name. This will appear on all your commits. You should use your real e-mail, but you can obfuscate it if you are afraid of spam.
Obfuscated e-mail example: bzr whoami "John Q. Public <john dot q dot public at-sign bigmail dot com>"
Unobfuscated e-mail example: bzr whoami "John Q. Public <firstname.lastname@example.org>"
Bazaar can be used exactly like SVN.
- Get the latest Inkscape code: bzr checkout lp:inkscape
- Make changes to the files. If you add new files, add them to version control with bzr add file. You can recursively add all new files by writing simply bzr add in the top level directory.
- Commit the changes, making them accessible to others: bzr commit
- Receive the most up-to-date version of the code: bzr update
This will asumme this directory layout:
inkscape +-trunk | +-doc | +-share | +-src | +-po | +-... +-my-branch +-some-other-branch
If you are working on several things at once, it's better to use one branch per feature. Here is how to work with branches.
- Create a shared repository for your branches. This brings significant space savings if you have several branches, but is not mandatory: bzr init-repo inkscape. This will create the directory inkscape, which will contain a shared repository used by all branches within it. Enter this directory: cd inkscape
- Create a new branch: bzr branch lp:inkscape my-branch. This will retrieve the main branch of Inkscape and put it in the subdirectory my-branch.
- Make changes. Commit them locally using bzr commit. Note that this doesn't touch the trunk on Launchpad; you are only committing to your local repository.
- If somebody else modified the trunk, resync with it: bzr merge (merging will automatically use the parent branch if none is specified)
Publishing branches on Launchpad
To publsh branches on Launchpad, you have to add an SSH key to your account. You can generate a key using the program ssh-keygen.
When you added a key to your account, you can now use the Launchpad integration features.
- First you have to log in: bzr launchpad-login launchpad-username. You need to use your username, rather than the display name.
- Publish your branch on Launchpad: bzr push lp:~launchpad-username/inkscape/my-branch. Of course if you're working with a different project, substitute inkscape with its Launchpad name.
- The push location will be saved. To update the branch on Launchpad, write <ttbzr push after your commits.
- If you want to always commit directly to the remote branch on Launchpad, write bzr bind lp:~launchpad-username/inkscape/my-branch after the initial push. This will convert your local branch into a checkout of the remote branch.
Merging branches into trunk
- Navigate to a checkout of the trunk.
- Execute bzr merge branch-url. This will modify the files to receive the changes from the specified branch but will not modify the trunk.
- After verifying the changes (e.g. compile the program and see whether it doesn't crash on startup), execute bzr commit to apply the changes from the merge to the trunk.
Naturally, all this also works locally. For example, when you're in the inkscape directory, you can write bzr branch trunk export-dialog to create a new branch of the trunk called export-dialog, where you'll work only on improving the export dialog. Similarly, you can merge between local branches.