2. Who am I?
Tim Penhey
http://howbazaar.blogspot.com
https://launchpad.net/~thumper
Currently employed by Canonical
http://canonical.com
Work on Launchpad integrating Bazaar
https://launchpad.net/launchpadbazaar
3. Version Control is Good
”Those who cannot learn from history
are doomed to repeat it”
George Santayana
4. Because this sucks
$ cp myfile.txt myfile.txt.20090120
$ ls myfile*
myfile.txt.bak
myfile.txt
myfile.txt.20090120
myfile.txt.20081218
5. Older Version Control Systems
SCCS
RCS
CVS
Subversion
SourceSafe (the less said about this the better)
Perforce
6. Distributed is Better
Sometimes you cannot reach the central server
e.g. A laptop on the move
Should still be able to record changes in a
meaningful manner
A local history is available
7. Which trunk is true?
If everyone has a local copy of the project,
who's copy is the ”true trunk”?
Projects that use distributed version control use
social convention
8. Bazaar Concepts
Branches
Revisions
Repositories
Working Trees
Formats
9. What is a branch?
A line of development
Common to use feature branches
this is where each feature is developed in its own
branch
Lives in a directory on the filesystem
all branches are addressable with a URI
web or filesystem addressable
10. What is a revision?
A revision is a collection of modifications
e.g. an applied patch
e.g. updated foo.c and foo.h
Has a committer
The person who called `bzr commit`
May have a different author
Allows work to be attributed to someone else
Has a unique identifier (revision id)
11. What is a branch?
A pointer to a tip revision
a revision has one parent for a simple commit
a revision has multiple parents for merges
A directed acyclic graph of revisions
and you though graph theory had no practical
applications
14. What is a format?
Each 'object' in Bazaar has a disk format
Formats allow for a smooth upgrade path
Developers knew that they weren't perfect and
planned for future improvements
`bzr upgrade` used to move to newer shiney
formats
15. Simple Example
$ cd myproject
$ bzr init
$ bzr add
added hello.txt
$ bzr commit
Committed revision 1.
16. Sharing your work
The push command pushes your work to a
different location
bzr push ~/public_html/myproject
Bazaar remembers this location so next time all
you need to do is:
bzr push
17. Collaborating
Get someone else's work
bzr branch http://example.com/fooix/featurex
Merge it in with your work
bzr merge ../featurex
(you don't actually need to get it first, you can just
merge in the remote branch)
Commit – bzr doesn't auto commit
Enjoy distributed goodness
19. Launchpad
Bazaar hosting
Code reviews
Managing projects and teams
Bug tracking
Translations
Personal Package Archives (PPAs)
20. Sharing with Launchpad
Register
Add an SSH key
Push up a branch related to a project:
bzr push lp:~username/projectname/branchname
Push up a branch of unrelated stuff:
bzr push lp:~username/+junk/branchname
21. Projects in Launchpad
Projects can specify a main branch
bzr branch lp:projectname
Projects can have multiple series
bzr branch lp:bzr/1.10
bzr branch lp:bzr/1.11
23. bzr shelve
Works on uncommitted work by default
Can refer to historical changes
Puts changes on a shelf
(a directory out of the way)
Can either put all changes 'a' flag, or
interactively choose changes
unshelve brings the changes back
24. Plugins
Extensibility through plugins
Can add new commands or modify existing
ones
bzrsvn – Interact with Subversion
bzremail – Send emails of changes
bzrtools – Extra useful commands
Can even add new formats
bzrloom – Work with a stack of lightweight
branches
26. Familiarity
Commands that relate clearly to other VCSs
blame (annotate)
commit
log
update
status
27. Sensible ignored files
By default
*.a, *.o, *.py[co], *.so, *.sw[nop], *~, .#*, [#]*#
More can be added easily
bzr ignore *.dll
Project specific ignores are stored in .bzrignore
Just because something is ignored, doesn't
mean it can't be added
28. Aliases
$ bzr alias
bzr alias commit=”commit strict”
bzr alias ll=”log line r 10..1
bzr alias unalias=”alias remove”
29. Well tested
Development follows test driven development
practices – and has done from the start
All new code needs test coverage
Over 10,000 tests
All tests are run on every attempted merge into
trunk
30. Other misc bits
Clear API
Useful when writing plugins
Tool integration through XML interface
It just works
Doesn't get in the way
31. Bazaar's Curse
Too adaptive?
Local repository or remote repository
Bound or unbound branches
Lightweight / heavyweight checkouts
Repositories with or without working trees