Ubuntu Open Week - Bazaar - Martin Pool - Mon, Apr 23, 2007

see also Wednesday Session.


(05:06:05 PM) poolie: good morning class
(05:06:21 PM) poolie: i'm martin pool, i work on Bazaar at Canonical with jam-laptop
(05:06:41 PM) poolie: and some other folks
(05:07:34 PM) poolie: Bazaar is a version control system designed to work well for ubuntu developers and to work well with launchpad
(05:07:42 PM) poolie: and to be easy to learn and pleasant to use
(05:07:53 PM) poolie: 'what is a version control system'?
(05:08:13 PM) poolie: well it remembers the changes you have made to a source tree, so that you can go back and see why changes were made
(05:08:15 PM) poolie: undo changes
(05:08:19 PM) poolie: review incoming work
(05:09:39 PM) poolie: merge in someone else's work,
(05:09:46 PM) poolie: and publish your changes
(05:09:55 PM) jam-laptop: Hi all
(05:10:10 PM) poolie: there are many other systems, including cvs, svn, monotone, darcs, git, mercurial
(05:10:23 PM) poolie: some of the distinguishing features of bazaar include:
(05:10:45 PM) poolie: very good support for windows, mac and linux
(05:11:06 PM) poolie: a simple user interface and attention to keeping it friendly
(05:11:12 PM) poolie: a good python scripting api
(05:11:41 PM) poolie: ability to host branches on any web or ftp or file server without needing to run a special daemon
(05:12:03 PM) poolie: and very good handling of refactorings like renaming files or directories
(05:12:07 PM) poolie: i'll look at some qns

<zorglu_> QUESTION: so bazaar has been designed to fit ubuntu ? and this is not ubuntu which choosed to because it fitted its need ?

  • ubuntu (well, Canonical) was originally basing our work on Arch, an existing system and contributing patches to that

<KalleDK> QUESTIONS What are the pros and cons versus SVN

  • It wasn't really going in the direction we thought was best, so we started a new system taking the parts we liked from Arch. The pros: no need for a central server, can commit and do other work while disconnected, much better merge tracking and smarter merging. The cons: mostly that it's a younger system, so somewhat less polished, less tools integration, etc. But we plan to go 1.0 in a few months, and there is some work towards gnome, eclipse and visual studio integration

How does bazaar do without a central server to track everything?

  • In Bazaar, each branch lives at a url, and carries a description of its history, including what has been merged in to it. When you merge from one branch to another, the system works out what's different between them and what has to be done.

    Let's try it! On ubuntu, apt-get install bzr then cd to some suitable directory (like your home) and do bzr branch After a little while, this will give you a toy source tree i made for this project.

<awkorama> QUESTION: So client side bazaar is just a bunch of scripts and server-side it can be only one ftp server?

  • Uh not just "a bunch of scripts" :-), a suite of lovingly hand-crafted python modules Smile :-) that give you one program 'bzr' with various commands. On the server side it can be an ftp, sftp, http, server or you can run the bazaar 'smart server' which is somewhat faster, and will become much faster in future releases

<mc44> question: why bother to make it work well with mac and windows?

  • Good question. It's because many open source projects, even if their core developers only use ubuntu, end up being ported to Windows. It can be a pain to support windows but if you keep it in mind during the design it's not that bad.

<Monika|K> QUESTION: Bazaar works well for Linux and Ubuntu. Does it also work well for other types of software development, i.e. could/should/will it replace CVS/SVN eventually?

  • Yes, it does. It's used by a number of people for internal/commercial development. I would say it's certainly an improvement on cvs, and depending on your situation could well be better than svn.

    <jam-laptop> I would also like to point out that we have the ability to interoperate with an upstream SVN server with the bzr-svn plugin. oh good point jam-laptop

    <jam-laptop> Which allows you to pull changes from SVN, do your commits in bzr, and (if you have commit rights to SVN) lets you merge your changes back. is the project page.

<dabaR> I only got one file, hello when I branched his URL

  • If you ran that command "bzr branch" you should have got a directory 'seminar' containing one file, 'hello' with some text in it. If you cd to that directory and run 'bzr log' then you should see that i created it early this morning. ddaa points out there is also a hidden directory .bzr which contains our control files.

<nansub0111> QUESTION: does the bzr-svn plug-in work the other way as well too? Suppose I use bzr locally for version control, but the public repository is subversion. Thanks

<nansub0111> COMMENT: I should clarify I want to use subversion only for releasing public files

  • <jam-laptop> There is some work to support serving SVN information from a bzr repository. So people with only an SVN client can still check out your source code. You can push back into svn from bzr. As an alternative approach.

    <jam-laptop> I believe the basic "checkout" support is functional, but you cannot commit yet. oh maybe not then.

    <nansub0111> I ask because i am using googlecode to host a project, but all of my version control is done with bazaar.

    <jam-laptop> For this setup, bzr-svn would definitely work. You could do your work locally using bzr and then merge/commit back to googlecode's svn repository.

QUESTION: sabdfl has talking about the importance of revision control in freedom even other than code. Can bazaar be used for non code applications? what sort of applications do you think it could be useful for

  • you can certainly use it for documentation, web content. Other things that are not code but look a bit more like code. I agree with mark about the importance of free collaboration on other things. Bazaar at the moment is a bit biased towards "things that look like code", (Eg you cannot comfortably commit very large binary files.) but the real issue in collaborating on, say, graphics or music is that it is sometimes hard to merge the changes if two people have modified them.

<Xk2c> QUESTION: will pakages be handeld via bzr in future?

  • Yes, they will at the moment some packages are maintained in bazaar trees, and there are some tools to help you do this. There is a list of these packages on the ubuntu wiki i believe.

<PriceChild> launchpad is managing some sources in bzr isn't it?

  • launchpad does a few things with bazaar. Bazaar is the way that launchpad thinks about code, if you like. Firstly, it can host your branches so other people can get them like the url i gave above and it provides a directory of branches, like These branches are owned by the 'bzr' group, and any of us can commit to them. You can see that some of them are linked to bugs and if you click through you can also see the code within them. Launchpad also provides a service of automated imports from svn or cvs to bzr

<ucap> QUESTION: Is there a tutorial somewhere? What other resources would you recommend to get to know bazaar?

  • There is on bazaar-vcs,org, and there are usually people in #bzr on freenode who can help or write to bazaar AT lists DOT ubuntu DOT com

<tekNico> QUESTION: Is BazaarNG ever going to get small, simple *and* fast as Mercurial? ;-)

  • Yes, we're *very focused* on speed and it's getting faster in every release. Many thanks due to jam-laptop in that area.

<jam-laptop> for an example of a non-code project using ubuntu:

<alienSkull> QUESTION: Do you use Bazaar while developing Bazaar?

  • Yes of course, like many ubuntu-related projects we do review of new contributions when people post new patches to the list, it's caught by Which keeps track of the review comments, and uses bzr to find out when they're merged.

<zorglu_> QUESTION: what is the status of the eclipse plugin ? how stable it is, can i feel confident that it wont crash my precious source code ? :)

  • sorry i don't know off hand, i don't use eclipse. Best to ask on the list.

    <jam-laptop:> I've followed it a bit. It is still pretty early on. Since it uses bzr as the back end, it won't "crash your precious source code." But it may get fussy when you try to use it. Since Eclipse needs to be taught how to think like bzr.

(05:41:59 PM) PriceChild: dabaR, would like to see the continuation of the demo you were doing poolie.
(05:42:46 PM) poolie: ok
(05:42:59 PM) poolie: so at least one person now has a copy of my code
(05:43:13 PM) poolie: now edit 'hello' in your favourite editor
(05:43:43 PM) poolie: add a line of text or two
(05:43:48 PM) poolie: save/exit
(05:43:52 PM) poolie: and run 'bzr diff'
(05:43:57 PM) poolie: and it shows you what you've change
(05:44:05 PM) poolie: and 'bzr status' summarizes that
(05:44:13 PM) poolie: this should be familiar from cvs or svn
(05:44:20 PM) poolie: you can now 'bzr commit'
(05:44:39 PM) poolie: this may be surprising - you don't have write access to my branch - but you can do it into your new local branch
(05:45:27 PM) poolie: now try 'bzr log' and it should show your change following mine
(05:45:45 PM) poolie: i'll let people catch up...

<ranf_> QUESTION: how do I see where it got commited to?

  • that's kind of an interesting question. It gets committed to whatever branch you're currently in.

<Demon012> QUESTION: How do you tell bazaar to commit to another location like for an example an FTP Server?

  • You can do this in two ways. If you want to commit directly there, every time you type commit. Then you should make a branch on the server with bzr init, then from your machine do 'bzr bind ftp://euthaoeuthaoeu'. But what i'm going to recommend here is that you instead push your changes to the server after you've made them so you can do 'bzr push URL' where URL is an sftp or ftp url. If you have a launchpad account with ssh keys, you can push there with bzr push s Change 'mbp' to your name. Branches on launchpad need to be associated with a product, here we have "+junk" to say it's not.

<nealmcb> QUESTION: I'd like to use bzr to manage changes to configurations in /etc and maybe other places. The documentation mentions this, but I'd love to see best practices or examples tailored to sysadmin. And I'd love to be able to host the repository somewhere other than in /etc or / itself.

  • <jam-laptop> That is a more involved situation and some people have certainly thought about it a bit. The #1 solution I've seen, is that you version the tree in another location and then use symlinks to point into it. This lets you version sub-pieces of /etc in different branches and keeps the VCS data separated from the running files

<dAndy> QUESTION: Is bzr entirely python or is there C mixed in for better performance? What else is being done to improve performance?

  • At the moment the main release is all python, but we will likely add C soon, actually pyrex, a python-like language that compiles to C.

    <jam-laptop> I think in general we have focused on getting the right algorithm in python. The main things we're doing on performance atm are doing less io, and doing more efficient network traffic.

    <jam-laptop> It is much easier to switch from a O(N2) algorithm to an O(logN) one in python and once we have that, we can optimize for C/Python speeds. Rather than trying to make a really fast C O(N2) algorithm, that will always end up slow.

<ranf_> COMMENT: for the push I had to include my LP username like so "bzr push s"

  • ah true, i have the same name on my machine.

<Demon012> QUESTION: is there any web based bazaar clients that can be used to submit changes to a branch? or even to just view the contents revisions to them?

<dabaR> < rulus> Question: how to get your change to poolie's branch?

  • You can get your changes in in several ways: if you had write access (which you don't here) then just push in directly. Otherwise, i need to merge it. You can do 'bzr bundle' to produce a text file you can mail to me or you can post the public url (eg http) into -chat, and i'll merge from there.

<ucap> QUESTION: How important is launchpad for the success of bazaar and/or vice-versa?

  • They're pretty complimentary, and we work closely together. I think launchpad is exciting because it can have such an integrated view of the code and bazaar because launchpad gives you a centralized view that's otherwise missing - helping you find the branches that fix different bugs for example.

<KalleDK> QUESTION How about roll back.. is that merge a earlier version and commit as svn or is there a rollback feature

  • To revert your working directory, 'bzr revert'. See also uncommit, and 'bzr revert -r -2' to discard changes from the last two, or 'bzr merge -r -20..-19' to reverse one change.

    <jam-laptop> I would also comment that we have "bzr uncommit" in case you want to throw away changes from your branch completely.

(06:00:13 PM) poolie: thanks very much, interesting questions
(06:00:46 PM) jam-laptop: You are all also welcome in #bzr on this server
(06:00:51 PM) jam-laptop: Feel free to ask questions there
(06:00:56 PM) poolie: thanks jam

MeetingLogs/openweekfeisty/Bazaar (last edited 2008-08-06 16:16:17 by localhost)