Ubuntu Open Week - Bazaar - Martin Pool - Wed, Apr 25, 2007

see also Monday Session.

TZ UTC-4

(04:01:52 PM) poolie: ok, let's go
(04:01:52 PM) mohnkern_: Cool.
(04:02:04 PM) poolie: this session is about Bazaar
(04:02:25 PM) poolie: i'm Martin Pool, one of the Bazaar developers
(04:02:39 PM) poolie: we also have jam, John Arbash Meinel, also a Bazaar developer
(04:02:44 PM) jam: Hi all
(04:02:54 PM) poolie: to start with, what is Bazaar?
(04:03:07 PM) poolie: Bazaar is a distributed version control system
(04:03:39 PM) poolie: it keeps a history of changes to a source code tree
(04:04:14 PM) poolie: and aids in: finding out what was changed, when, why, by whom
(04:04:16 PM) poolie: merging
(04:04:24 PM) poolie: merging changes made by different people
(04:04:55 PM) poolie: undoing mistakes, doing code review and so on

<mohnkern_> QUESTION: Like Subversion?

<Treenaks> QUESTION: How 'good' is Windows support? Are there plugins that do 'graphical things' like the GTK plugins in Linux? Do the GTK Plugins work in Windows if you can find pygtk + gtk for windows?

(04:10:29 PM) poolie: ok so
(04:10:50 PM) poolie: we're going to quickly go through a demo of how you might contribute a fix to someone else's source tree
(04:11:11 PM) poolie: if you're on ubuntu, do 'sudo apt-get install bzr' to make sure it's there
(04:11:29 PM) poolie: on other platforms look at bazaar-vcs.org
(04:12:07 PM) poolie: this tree is hosted on launchpad - hosting of Bazaar branches is one feature Launchpad offers as well as bug tracking, translations, etc
(04:13:12 PM) poolie: so if you're ready to go let's
(04:13:46 PM) poolie: type
(04:13:51 PM) poolie: bzr branch http://bazaar.launchpad.net/~mbp/+junk/seminar
(04:14:11 PM) poolie: this will download a copy of my sample branch into a directory called 'seminar'
(04:14:34 PM) poolie: you've now made a new independent branch
(04:14:38 PM) poolie: cd into there
(04:14:43 PM) poolie: you'll see one file
(04:14:57 PM) poolie: you can type 'bzr log' to see the history of when it was created
(04:15:31 PM) poolie: there is also a .bzr directory containing control information
(04:15:51 PM) poolie: now edit 'hello' in your text editor
(04:15:58 PM) poolie: add a line or something, save and exit
(04:16:08 PM) poolie: try 'bzr diff' and it will show you what you changed
(04:16:24 PM) poolie: try 'bzr status' and it will tell you just the name of the file you changed
(04:17:11 PM) poolie: 'bzr help' tells you other things you  can do, like adding, deleting and renaming files
(04:17:30 PM) poolie: if you're happy with your change, do 'bzr commit' and it will ask you for a message describing the change
(04:18:35 PM) poolie: this commit has now gone into your branch, which has diverged from mine
(04:19:00 PM) poolie: if you do bzr log, you'll see that your name is in there too
(04:19:20 PM) poolie: this works without you needing to be added to our project, or even to have a launchpad login
(04:19:24 PM) poolie: which is different to cvs
(04:20:08 PM) poolie: if you have a launchpad account, you can push your changes back up, with
(04:20:34 PM) poolie: bzr push sftp://USERNAME@bazaar.launchpad.net/~USERNAME/+junk/seminar
(04:21:43 PM) poolie: the +junk stands in place of a product name - normally they must be associated with a product so we can link them up
(04:21:52 PM) poolie: now i've also committed a change to my branch
(04:22:25 PM) poolie: so if you do 'bzr merge' it will integrate your changes with what i've done
(04:22:37 PM) poolie: this will probably cause a conflict if we both changed the same part of the same file

<Loic> QUESTION: When I do "bzr commit" it opens nano. What am I supposed to do there?

(04:25:16 PM) poolie: ok so please say in -chat if you've successfully got a file with conflicts?
(04:26:03 PM) poolie: now you'll want to edit that file, to resolve the conflict - remove the marker lines, and choose one or both new bits that you want to keep
(04:26:10 PM) poolie: then do 'bzr resolved hello'
(04:26:25 PM) poolie: and then you can commit again, this time you can give the message on the command line with
(04:26:33 PM) poolie: bzr commit -m "merge from martin"
(04:27:14 PM) poolie: it's also worth mentioning that in the upcoming 0.16 release, you can also link to bugs when you commit
(04:27:30 PM) poolie: for launchpad, bzr commit --fixes lp:202020
(04:28:05 PM) poolie: ok as some people have noticed
(04:28:12 PM) poolie: after your commit, you can run bzr lgo
(04:28:15 PM) poolie: or even log
(04:28:28 PM) poolie: and it shows you the merged-in revisions indented
(04:30:14 PM) poolie: ok, so this has just got the fix into your branch
(04:30:23 PM) poolie: if you wanted to share it with me you have a few option
(04:30:32 PM) poolie: you could push to launchpad, and tell me about the branch
(04:30:36 PM) poolie: or to another web server
(04:31:08 PM) poolie: or, you can do 'bzr bundle' which gives you an enhanced diff suitable for mailing to a person or a list
(04:31:16 PM) poolie: and they can then do 'bzr merge BUNDLEFILE'
(04:31:31 PM) poolie: ok, so to wrap up, i'll show you how to start a new project
(04:31:56 PM) poolie: we need to introduce the concept here of 'repositories' which is a directory that stores information about a set of related projects
(04:32:37 PM) poolie: to use less disk space, and so that when you push or pull from them, it does it only once

<frosty__> QUESTION: When would I use merge, and when would I use pull?

<frosty__> QUESTION: So what if there are conflicts when you pull?

(04:38:31 PM) poolie: ok
(04:38:57 PM) poolie: so to wrap up 'starting a new project'
(04:39:32 PM) poolie: to make a new branch, do 'bzr init DIR' - can be either an existing unversioned source tree, or it will create a directory
(04:40:07 PM) poolie: you can tell bazaar about files to ignore - typically build products like *.o or *.pyc
(04:40:20 PM) poolie: using 'bzr ignore', or by editing .bzrignore at the top level
(04:41:02 PM) poolie: then do 'bzr add' to tell bazaar you want to version all the files, or you can add them individually
(04:41:10 PM) poolie: then commit, and you're off and running
(04:41:27 PM) poolie: that concludes my tutorial content -- jam, anything to add?
(04:41:55 PM) jam: poolie: I think that is good, as long as people don't have more questions on the demo
(04:42:10 PM) poolie: let's do some questions then

<ih70> QUESTION: Why do we need yet another source control system. What objectives does bzr achieve that are not possible in say SVN? <frosty__> QUESTION: Why should someone use bazaar, over another distributed system? Say, darcs, git, or mercurial?

<Adhemar> QUESTION: (As a non-programmer) Suppose I would like to have a versioned home directory (not just source, most of it text though) (the Video directory excluded) and have the home of my laptop "merged" regularly with the home of my desktop. Would using bzr make sense somehow? (Or are you aware of better alternatives, maybe transparent versioned file systems for Ubuntu?)

<ih70> QUESTION: How well does bzr deal with binary files?

<rmunn> QUESTION: If I'm using bzr, but upstream isn't, how do I easily create a patch to present to them? Is there a "bzr push --patch" or some such command?

<txwikinger> QUESTION: Can you push through web proxies, using dav, and on web servers needing authentication?

<Loic> QUESTION: Is it possible to use bzr for package creation, and has it been done (pros/cons)?

<rulus> question: I'm using bzr for school reports made in Latex. I'm thinking of hosting the branch on my webspace as a backup, and then commit changes to it through bzr. However, I don't want the whole world to read my school reports. Is there some bzr gpg plugin to en/decrypt on the fly?

(05:00:48 PM) poolie: time to finish...
(05:01:26 PM) jam: I think we need to wrap it up
(05:01:30 PM) jam: Since it is time for the next session
(05:01:39 PM) jam: But I would like to invite everyone to #bzr if they have any more questions
(05:05:19 PM) jam: As always, questions are more than welcome in #bzr
(05:05:25 PM) jam: Thanks to everyone who participated.

MeetingLogs/openweekfeisty/Bazaar2 (last edited 2008-08-06 16:29:38 by localhost)