== App Developer Week -- Introducing Bazaar Explorer: Version Control for your Apps - Riddell -- Mon, Sep 5th, 2011 == {{{#!irc [17:01] Next up is Jonathan Riddell, the Kubuntu rockstar who's on his way of becoming a bzr rockstar this cycle too [17:01] good day everyone [17:02] I'm going to give an introduction to Bazaar Explorer [17:02] and convince you it's a developer tool everyone should use [17:02] you can follow along by following the images at http://ec2-184-72-177-203.compute-1.amazonaws.com/owncloud/ [17:02] access with guest/guest [17:03] Bazaar is the world's finest revision control system [17:03] if you're coding on files, or even have any non coding files you should use it to keep track of them [17:03] it's fully distributed so you can use it to collaborate with others very easily [17:04] you don't need a fancy server to use it, it works locally fine [17:04] but it's also easy to put on a server, http or ssh is all you need [17:04] if you don't want it distributed you don't have to [17:04] and it's designed to be easy to use for people familiar with CVS or Subversion [17:05] it gives the full power of tools like git but it's understandable to people other than Linus [17:05] it's used everywhere in ubuntu [17:05] to store all our packaging and code [17:05] and it's used in large projects like mysql [17:06] most people will be familiar with Bazaar through bzr, the command line interface [17:06] command line interfaces are great for those of use who are comfortable with command lines [17:07] but as Ubuntu spreads out amongst non-geeks we need it to be available to everyone [17:07] and besides sometimes GUIs are just better even for hardcore geeks [17:07] so Bazaar Explorer is the GUI for Bazaar [17:07] well I should say it's /a/ GUI for Bazaar [17:07] but it is by far the most complete [17:08] bulldog98 asked: what toolkit is it written in? [17:08] it's written in Qt with Python [17:08] an excellent choice for writing any GUI application [17:09] Qt means its cross platform so it runs anywhere [17:09] Python means its easy to fix and improve [17:09] you can install it from any package manager [17:09] sudo apt-get install bzr-explorer will do it [17:10] and run it from the application menu where it's listed as Bazaar Explorer [17:10] or from a command line as: bzr explorer [17:11] when you start it, it'll look like the image 01 on that owncloud server or http://www.flickr.com/photos/jriddell/6116796188/in/photostream [17:11] actually if you've never used Bazaar before it'll probably prompt you for your name and e-mail first [17:13] bulldog98 asked: what toolkit is it written in? [17:13] bulldog98 asked: why does the oneiric package depends on tango? Can’t oxygen be used? [17:13] hmm, this bot is fiddly [17:13] it uses Tango icons, there's not currently an option to use Oxygen icons I'm afraid [17:13] fixes welcome :) [17:14] let's use bzr explorer to get some code [17:14] http://www.flickr.com/photos/jriddell/6116252311/in/photostream shows us going to the "Get project sources from elsewhere" tab [17:15] I want to branch a project to make a change to it [17:15] so I click on the Branch button and enter into the address box lp:ubuntu-cdimage [17:15] http://www.flickr.com/photos/jriddell/6116802008/in/photostream [17:15] you can host Bazaar branches anywhere but one of the most common places to do so is in Launchpad [17:16] which hosts any free software project for free, how very generous [17:16] Launchpad branches have a nice shortcut to their location which is lp: [17:16] and in this case I'm wanting the trunk from the ubuntu-cdimage project [17:16] so I tell it to branch that code [17:17] http://www.flickr.com/photos/jriddell/6116257777/in/photostream [17:17] ah but wait, what's this, which I like to initialise a shared repository? [17:17] bzr is so good at making branches that it's common to make a new branch for any notable change [17:18] then you can edit the branch with out worrying about mistakes [17:18] and merge it into the main branch when you're happy [17:18] this leaves a load of branch directories around on your hard disk [17:18] which might be wasteful of disk space [17:19] so a shared repository will share all the history which is the same in your branches [17:19] so yes we do want to make the shared repository [17:19] a new dialogue box pops up http://www.flickr.com/photos/jriddell/6116801334/in/photostream/ [17:20] we let it do its initialisation then we get the branch we want http://www.flickr.com/photos/jriddell/6116800620/in/photostream/ [17:20] an voila, bzr explorer is ready to work on this branch http://www.flickr.com/photos/jriddell/6116800344/in/photostream/ [17:20] I can’t see a pic in the owncloud server [17:21] well just use the flickr images, they're the same [17:21] if you look in a file manager it will have made a ubuntu-cdimage/ directory and within it a trunk/ directory [17:22] the ubuntu-cdimage/ directory is our shared repository and the trunk/ directory is our branch we just made [17:23] in the bottom right of Bazaar Explorer is the working tree, you can open files from there to edit them if you wish [17:23] or open the whole directory in a file manager or an IDE [17:23] today I'm going to add a new Ubuntu flavour [17:23] Bazaarbuntu! [17:23] it's going to be the distro to take over the world [17:24] so I'll edit the file in ubuntu-cdimage to start making those CD images http://www.flickr.com/photos/jriddell/6116800100/in/photostream/ [17:25] having made the edit the Bazaar Explorer page will refresh to note that I have changes [17:25] (if it doesn't automatically refresh then you have a version without my automatic refresh patch, you can click the "refresh" button) [17:25] if I want to see my changes I can click on Diff http://www.flickr.com/photos/jriddell/6116255747/in/photostream/ [17:26] and if I want to save the change to the Bazaar repository I can click on commit http://www.flickr.com/photos/jriddell/6116804398/in/photostream [17:27] this will save the change to my local branch [17:27] but now I want to publish the change to the wider world so I need to push it to another location which is publically available [17:27] http://www.flickr.com/photos/jriddell/6116803820/in/photostream/ [17:27] there I'm pushing it to a branch on Launchpad [17:29] so now anyone can see my branch on the web https://code.launchpad.net/~jr/+junk/bazaarbuntu [17:29] and anyone can download it or review the change [17:29] Bazaar Explorer can access most of the functions of bzr, such as looking at the log of commits [17:29] http://www.flickr.com/photos/jriddell/6116803174/in/photostream/ [17:30] http://www.flickr.com/photos/jriddell/6116258943/in/photostream/ [17:30] infact it can access all the functions of bzr because if there's a bzr command without a gui you can use the "All" option to run it [17:31] if I want to make more complex changes I probably want to make a new local branch http://www.flickr.com/photos/jriddell/6116802386/in/photostream/ [17:32] and work on that, then merge it in to trunk when I'm happy [17:33] of course you don't always care about having branches [17:34] you might prefer to work more like subversion or cvs where you just checkout directly from the server [17:34] and commit directly back [17:34] Bazaar and Bazaar Explorer support this [17:34] back on the welcome page i click Checkout http://www.flickr.com/photos/jriddell/6116798884 [17:35] here I checkout the ubuntu seeds [17:35] I make my change (adding bzr-explorer) [17:35] and commit directly back http://www.flickr.com/photos/jriddell/6116798624/ [17:35] that's working with existing projects [17:36] but we are App Developers and we want to make our own projects! [17:36] the Welcome page has a "Start a new Project" tab [17:36] http://www.flickr.com/photos/jriddell/6116798364 [17:37] I initialise a new project [17:37] there's a few options for what sort of branch you want, Feature Branches is the best sort for most cases [17:37] that'll make a shared repository and a trunk branch inside it [17:38] http://www.flickr.com/photos/jriddell/6116798064 [17:38] this takes us to a new page which lists the available branches [17:38] from here we can open a branch or make a new one [17:39] as a new project working on trunk is expected so we can add our files http://www.flickr.com/photos/jriddell/6116254211 [17:39] and commit them http://www.flickr.com/photos/jriddell/6116253927 [17:39] http://www.flickr.com/photos/jriddell/6116797120 [17:39] and if I wanted I could push it to Launchpad or anywhere else [17:40] bazaar explorer is awesome! [17:40] why thank you trinikrono, free hugs to you [17:40] now I said that Bazaar is used throughtout Ubuntu [17:41] we now have (almost) every ubuntu package kept in a Bazaar branch [17:41] so you can use Bazaar Explorer to branch any Ubuntu package if you feel the need to fix it or otherwise look at the source code [17:41] http://www.flickr.com/photos/jriddell/6116796880 [17:42] here I'm getting the code to Ubuntu's choqok package [17:42] by branching ubuntu:choqok [17:42] which gives me the code to work on http://www.flickr.com/photos/jriddell/6116796608 [17:42] bUbu87 asked: so upstream development just maps to pull requests on the package's launchpad branch? [17:43] bUbu87: you're talking about the Ubuntu package branches? Those are imports of packages in Ubuntu so they're not the upstream development branch [17:43] so if you want to fix a problem which is specific to ubuntu then use those [17:44] if it's a general problem in the program then use the normal upstream code whereeever that is kept [17:45] Bazaar Explorer is a nice GUI which works along with your IDE or file manager/text editor for working with code in Bazaar branches [17:45] there is a half way between the GUI and command line interfaces [17:46] which is to launch QBzr commands directly from the command line [17:46] so if you're into using command lines but want an easier way to, say, browse a branch history you can run [17:46] bzr qlog [17:46] instead of bzr log [17:46] which will give you a GUi to look at the log [17:47] I use this a lot whenever the history is more complex than straight commits [17:48] the same goes for bzr qcommit or bzr qbranch [17:48] it's a nice alternative for when the command line is showing its limitations [17:48] dpm asked: are there Bazaar Explorer packages for platforms other than Ubuntu? (e.g. Win, Mac...) [17:49] if you install Bazaaron Windows the installer comes with explorer [17:49] same for Mac I'm sure [17:49] so it's actually the main UI for non-Linux users [17:50] which is why if you follow the Take the Tour link on http://bazaar.canonical.com/en/ it shows you Bazaar Explorer [17:50] that's all I have prepared, any other questions? [17:50] There are 10 minutes remaining in the current session. [17:51] bulldog98 asked: will there be a port to freedesktop icon usage? [17:51] I see this is an important issue for you :) [17:52] I think when Bazaar Explorer was started Tango was the obvious choice [17:52] since then Oxygen has come along and the freedesktop icon standard is more available [17:52] but I don't think freedesktop icons are built into Qt so there's a little bit of code needed there [17:53] do file a bug if it's something you want done and hopefully we'll get round to iy [17:53] it [17:53] dpm asked: apart from Bazaar Explorer, are there other recommended graphical tools? I.e. I know there's qbzr and bzr-gtk, but I don't know if picking one over the other is a matter of choice or whether there is a recommended one to use [17:53] qbzr is the GUi for individual commands [17:53] e.g. bzr qlog [17:54] when you ask Bazaar Explorer to show you the branch log it will run QBzr's qlog [17:54] you can also tell Bazaar Explorer to run bzr-gtk commands instead of QBzr if you really want [17:54] but QBzr is generally better maintained and is the default [17:55] the other main graphical tool is Loggerhead which is the web UI [17:55] There are 5 minutes remaining in the current session. [17:55] elite Bazaar hackers recently changed that from spitting out HTML directly to spitting out JSON so it's now a lot more flexible as a way of making UIs [17:56] e.g. Launchpad can now show you a recent changes diff for merge proposals [17:56] there's some other UIs such as my own Dolphin Bazaar plugin for KDE's file manager [17:56] and there's even some experimental integration with Qt Creator [17:57] bulldog98 asked: is there a graphical way to see my bazaar config, eg what bazaar plugins are run after a commit (cia-client?) [17:57] The settings menu lets you change your Bazaar config [17:58] but it doesn't do everything from a GUI [17:58] User Configuration has your user setup [17:58] but stuff like cia plugin config can only be done with editing a text file for now (Settings -> Locations) [17:59] Bazaar Explorer is extendable so it should be possible for the bzr-cia plugin to add that [17:59] Mipixal asked: What about Bazaar branches that are mirrored from other sources (not hosted on Launchpad). Does pushing commits make them available only on Launchpad or to original sources too ? [18:00] it depends where you push them [18:00] if you push them back to where you got it from then it'll be available in the same place [18:00] if you push it to Launchpad it'll be available on Launchpad [18:00] there's no fixed tie in between bzr and Launchpad [18:00] it's just that Launchpad has been designed to work very well with Bazaar || Event: App Developer Week - Current Session: Your App and Launchpad best practices - Instructors: jderose [18:00] time up! [18:00] Thanks Riddell for a really awesome session - even with pictures! }}}