bazaar vcs lightning talk
DESCRIPTION
A brief introduction to the awesome Python based version control systemTRANSCRIPT
![Page 2: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/2.jpg)
Why Bazaar?
• Lightweight and simple
• Python based thus x-platform
• Plugin architecture
• No dependancy on a centralised repo
• Copies of revisions locally and remotely
• Allows commits locally when offline
![Page 3: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/3.jpg)
Set-up a versioned dir$ cd ~/bazaar
$ bzr init demo
~/bazaar/demo is now set-up to be versioned
![Page 4: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/4.jpg)
Let’s add a file$ cd ~/bazaar/demo
$ vim test.css
$ bzr add
![Page 5: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/5.jpg)
Let’s add a file$ cd ~/bazaar/demo
$ vim test.css
$ bzr add
added test.css
![Page 6: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/6.jpg)
First commit$ bzr commit -m “my first commit”
![Page 7: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/7.jpg)
First commit$ bzr commit -m “my first commit”
added test.css
Committed revision 1.
![Page 8: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/8.jpg)
PublishSimply copy the directory to a webserver
Other people can take a branch by running:
$ bzr branch http://server.co.uk/branch/dir/
For read write share via SFTP.
![Page 9: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/9.jpg)
Useful commandsbzr checkout - checks out branches.
bzr update - update the local files to match those in the repo.
bzr revert - reverts files back to a specific rev
bzr status - current status of modified, added and removed files
bzr log - the log of commits
bzr ignore - allows patterns of files to ignore .DS_Store!!
bzr uncommit - reverse a commit
bzr diff - provides a diff of revisions
![Page 10: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/10.jpg)
Shared Repository$ cd ~/bazaar/
$ bzr init-repo --no-trees sftp://server/path/to/bzr/
$ bzr init sftp://server/path/to/bzr/bigmuffin
$ bzr checkout sftp://server/path/to/bzr/bigmuffin remote
note: --no-trees prevents trees being created on the remote repo.
![Page 11: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/11.jpg)
Adding and committing$ cp -R ~/projects/bigmuffin/* ~/bazaar/bigmuffin/
$ bzr add
$ bzr status
$ bzr commit -m “bigmuffin project files added”
![Page 12: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/12.jpg)
ConflictsA conflict is created when the merging algorithm cannot make sense of the changes.
Should a conflict occur you will end up with several files being created.
If the file with a conflict is style.css you will end up with:
styles.css
styles.css.BASE - The common base
styles.css.OTHER - The branch
styles.css.THIS - Your changes.
![Page 13: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/13.jpg)
Resolving ConflictsCompare styles.css.OTHER and styles.css.THIS and manually rectify the differences.
The merged file needs to be called styles.css
Make sure you delete styles.css.THIS
Then run:
$ bzr resolve file
![Page 14: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/14.jpg)
Resolving ConflictsBazaar will automatically delete the other files
Macs have a really nice diff app for this which is included with xcode.
It’s called FileMerge.
![Page 15: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/15.jpg)
Branching & Merging$ cd ~/bazaar/
$ bzr branch sftp://server/path/to/bzr/bigmuffin sftp://server/path/to/bzr/myamazingfeature
$ bzr checkout sftp://server/path/to/bzr/myamazingfeature amazingfeature
$ cd amazingfeature
$ cd ~/bazaar/bigmuffin
$ bzr merge ../amazingfeature
![Page 16: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/16.jpg)
PluginsBazaar Email - a nice plugin that simply sends diffs of commits to an email address of your choice.
Publish-bot - sends commit messages to irc
Commit selector - allows you to choose what files you commit.
![Page 17: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/17.jpg)
Points of interestMozilla took a look at bazaar for version control and compared it with mecurial (http://www.selenic.com/mercurial/wiki/) another Python based decentralised VCS.
Their issue with bazaar was mainly around speed
but...
All of the points of speed have been a focus of the Bazaar team since then and as a result subsequent versions have increased dramtically in performance.
![Page 18: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/18.jpg)
Points of interestBazaar is a canonical project the people behind Ubuntu.
Launchpad.net is Canonical’s sourceforge. As a result it’s file hosting is built around bazaar. Though a little rough around the edges it shows promise.
![Page 19: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/19.jpg)
Easter Egg$ bzr rocks
![Page 20: Bazaar VCS Lightning Talk](https://reader034.vdocuments.net/reader034/viewer/2022042521/5555d14ad8b42a711f8b4a51/html5/thumbnails/20.jpg)
Easter Egg$ bzr rocks
It sure does!