App Developer Week -- Introducing Bazaar Explorer: Version Control for your Apps - Riddell -- Mon, Sep 5th, 2011
1 [17:01] <dpm> Next up is Jonathan Riddell, the Kubuntu rockstar who's on his way of becoming a bzr rockstar this cycle too 2 [17:01] <Riddell> good day everyone 3 [17:02] <Riddell> I'm going to give an introduction to Bazaar Explorer 4 [17:02] <Riddell> and convince you it's a developer tool everyone should use 5 [17:02] <Riddell> you can follow along by following the images at http://ec2-184-72-177-203.compute-1.amazonaws.com/owncloud/ 6 [17:02] <Riddell> access with guest/guest 7 [17:03] <Riddell> Bazaar is the world's finest revision control system 8 [17:03] <Riddell> if you're coding on files, or even have any non coding files you should use it to keep track of them 9 [17:03] <Riddell> it's fully distributed so you can use it to collaborate with others very easily 10 [17:04] <Riddell> you don't need a fancy server to use it, it works locally fine 11 [17:04] <Riddell> but it's also easy to put on a server, http or ssh is all you need 12 [17:04] <Riddell> if you don't want it distributed you don't have to 13 [17:04] <Riddell> and it's designed to be easy to use for people familiar with CVS or Subversion 14 [17:05] <Riddell> it gives the full power of tools like git but it's understandable to people other than Linus 15 [17:05] <Riddell> it's used everywhere in ubuntu 16 [17:05] <Riddell> to store all our packaging and code 17 [17:05] <Riddell> and it's used in large projects like mysql 18 [17:06] <Riddell> most people will be familiar with Bazaar through bzr, the command line interface 19 [17:06] <Riddell> command line interfaces are great for those of use who are comfortable with command lines 20 [17:07] <Riddell> but as Ubuntu spreads out amongst non-geeks we need it to be available to everyone 21 [17:07] <Riddell> and besides sometimes GUIs are just better even for hardcore geeks 22 [17:07] <Riddell> so Bazaar Explorer is the GUI for Bazaar 23 [17:07] <Riddell> well I should say it's /a/ GUI for Bazaar 24 [17:07] <Riddell> but it is by far the most complete 25 [17:08] <Riddell> bulldog98 asked: what toolkit is it written in? 26 [17:08] <Riddell> it's written in Qt with Python 27 [17:08] <Riddell> an excellent choice for writing any GUI application 28 [17:09] <Riddell> Qt means its cross platform so it runs anywhere 29 [17:09] <Riddell> Python means its easy to fix and improve 30 [17:09] <Riddell> you can install it from any package manager 31 [17:09] <Riddell> sudo apt-get install bzr-explorer will do it 32 [17:10] <Riddell> and run it from the application menu where it's listed as Bazaar Explorer 33 [17:10] <Riddell> or from a command line as: bzr explorer 34 [17:11] <Riddell> 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 35 [17:11] <Riddell> actually if you've never used Bazaar before it'll probably prompt you for your name and e-mail first 36 [17:13] <ClassBot> bulldog98 asked: what toolkit is it written in? 37 [17:13] <ClassBot> bulldog98 asked: why does the oneiric package depends on tango? Canâ€™t oxygen be used? 38 [17:13] <Riddell> hmm, this bot is fiddly 39 [17:13] <Riddell> it uses Tango icons, there's not currently an option to use Oxygen icons I'm afraid 40 [17:13] <Riddell> fixes welcome :) 41 [17:14] <Riddell> let's use bzr explorer to get some code 42 [17:14] <Riddell> http://www.flickr.com/photos/jriddell/6116252311/in/photostream shows us going to the "Get project sources from elsewhere" tab 43 [17:15] <Riddell> I want to branch a project to make a change to it 44 [17:15] <Riddell> so I click on the Branch button and enter into the address box lp:ubuntu-cdimage 45 [17:15] <Riddell> http://www.flickr.com/photos/jriddell/6116802008/in/photostream 46 [17:15] <Riddell> you can host Bazaar branches anywhere but one of the most common places to do so is in Launchpad 47 [17:16] <Riddell> which hosts any free software project for free, how very generous 48 [17:16] <Riddell> Launchpad branches have a nice shortcut to their location which is lp: 49 [17:16] <Riddell> and in this case I'm wanting the trunk from the ubuntu-cdimage project 50 [17:16] <Riddell> so I tell it to branch that code 51 [17:17] <Riddell> http://www.flickr.com/photos/jriddell/6116257777/in/photostream 52 [17:17] <Riddell> ah but wait, what's this, which I like to initialise a shared repository? 53 [17:17] <Riddell> bzr is so good at making branches that it's common to make a new branch for any notable change 54 [17:18] <Riddell> then you can edit the branch with out worrying about mistakes 55 [17:18] <Riddell> and merge it into the main branch when you're happy 56 [17:18] <Riddell> this leaves a load of branch directories around on your hard disk 57 [17:18] <Riddell> which might be wasteful of disk space 58 [17:19] <Riddell> so a shared repository will share all the history which is the same in your branches 59 [17:19] <Riddell> so yes we do want to make the shared repository 60 [17:19] <Riddell> a new dialogue box pops up http://www.flickr.com/photos/jriddell/6116801334/in/photostream/ 61 [17:20] <Riddell> we let it do its initialisation then we get the branch we want http://www.flickr.com/photos/jriddell/6116800620/in/photostream/ 62 [17:20] <Riddell> an voila, bzr explorer is ready to work on this branch http://www.flickr.com/photos/jriddell/6116800344/in/photostream/ 63 [17:20] <Riddell> <bulldog98> I canâ€™t see a pic in the owncloud server 64 [17:21] <Riddell> well just use the flickr images, they're the same 65 [17:21] <Riddell> if you look in a file manager it will have made a ubuntu-cdimage/ directory and within it a trunk/ directory 66 [17:22] <Riddell> the ubuntu-cdimage/ directory is our shared repository and the trunk/ directory is our branch we just made 67 [17:23] <Riddell> in the bottom right of Bazaar Explorer is the working tree, you can open files from there to edit them if you wish 68 [17:23] <Riddell> or open the whole directory in a file manager or an IDE 69 [17:23] <Riddell> today I'm going to add a new Ubuntu flavour 70 [17:23] <Riddell> Bazaarbuntu! 71 [17:23] <Riddell> it's going to be the distro to take over the world 72 [17:24] <Riddell> so I'll edit the file in ubuntu-cdimage to start making those CD images http://www.flickr.com/photos/jriddell/6116800100/in/photostream/ 73 [17:25] <Riddell> having made the edit the Bazaar Explorer page will refresh to note that I have changes 74 [17:25] <Riddell> (if it doesn't automatically refresh then you have a version without my automatic refresh patch, you can click the "refresh" button) 75 [17:25] <Riddell> if I want to see my changes I can click on Diff http://www.flickr.com/photos/jriddell/6116255747/in/photostream/ 76 [17:26] <Riddell> 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 77 [17:27] <Riddell> this will save the change to my local branch 78 [17:27] <Riddell> 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 79 [17:27] <Riddell> http://www.flickr.com/photos/jriddell/6116803820/in/photostream/ 80 [17:27] <Riddell> there I'm pushing it to a branch on Launchpad 81 [17:29] <Riddell> so now anyone can see my branch on the web https://code.launchpad.net/~jr/+junk/bazaarbuntu 82 [17:29] <Riddell> and anyone can download it or review the change 83 [17:29] <Riddell> Bazaar Explorer can access most of the functions of bzr, such as looking at the log of commits 84 [17:29] <Riddell> http://www.flickr.com/photos/jriddell/6116803174/in/photostream/ 85 [17:30] <Riddell> http://www.flickr.com/photos/jriddell/6116258943/in/photostream/ 86 [17:30] <Riddell> 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 87 [17:31] <Riddell> 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/ 88 [17:32] <Riddell> and work on that, then merge it in to trunk when I'm happy 89 [17:33] <Riddell> of course you don't always care about having branches 90 [17:34] <Riddell> you might prefer to work more like subversion or cvs where you just checkout directly from the server 91 [17:34] <Riddell> and commit directly back 92 [17:34] <Riddell> Bazaar and Bazaar Explorer support this 93 [17:34] <Riddell> back on the welcome page i click Checkout http://www.flickr.com/photos/jriddell/6116798884 94 [17:35] <Riddell> here I checkout the ubuntu seeds 95 [17:35] <Riddell> I make my change (adding bzr-explorer) 96 [17:35] <Riddell> and commit directly back http://www.flickr.com/photos/jriddell/6116798624/ 97 [17:35] <Riddell> that's working with existing projects 98 [17:36] <Riddell> but we are App Developers and we want to make our own projects! 99 [17:36] <Riddell> the Welcome page has a "Start a new Project" tab 100 [17:36] <Riddell> http://www.flickr.com/photos/jriddell/6116798364 101 [17:37] <Riddell> I initialise a new project 102 [17:37] <Riddell> there's a few options for what sort of branch you want, Feature Branches is the best sort for most cases 103 [17:37] <Riddell> that'll make a shared repository and a trunk branch inside it 104 [17:38] <Riddell> http://www.flickr.com/photos/jriddell/6116798064 105 [17:38] <Riddell> this takes us to a new page which lists the available branches 106 [17:38] <Riddell> from here we can open a branch or make a new one 107 [17:39] <Riddell> as a new project working on trunk is expected so we can add our files http://www.flickr.com/photos/jriddell/6116254211 108 [17:39] <Riddell> and commit them http://www.flickr.com/photos/jriddell/6116253927 109 [17:39] <Riddell> http://www.flickr.com/photos/jriddell/6116797120 110 [17:39] <Riddell> and if I wanted I could push it to Launchpad or anywhere else 111 [17:40] <Riddell> <trinikrono> bazaar explorer is awesome! 112 [17:40] <Riddell> why thank you trinikrono, free hugs to you 113 [17:40] <Riddell> now I said that Bazaar is used throughtout Ubuntu 114 [17:41] <Riddell> we now have (almost) every ubuntu package kept in a Bazaar branch 115 [17:41] <Riddell> 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 116 [17:41] <Riddell> http://www.flickr.com/photos/jriddell/6116796880 117 [17:42] <Riddell> here I'm getting the code to Ubuntu's choqok package 118 [17:42] <Riddell> by branching ubuntu:choqok 119 [17:42] <Riddell> which gives me the code to work on http://www.flickr.com/photos/jriddell/6116796608 120 [17:42] <ClassBot> bUbu87 asked: so upstream development just maps to pull requests on the package's launchpad branch? 121 [17:43] <Riddell> bUbu87: you're talking about the Ubuntu package branches? Those are imports of packages in Ubuntu so they're not the upstream development branch 122 [17:43] <Riddell> so if you want to fix a problem which is specific to ubuntu then use those 123 [17:44] <Riddell> if it's a general problem in the program then use the normal upstream code whereeever that is kept 124 [17:45] <Riddell> Bazaar Explorer is a nice GUI which works along with your IDE or file manager/text editor for working with code in Bazaar branches 125 [17:45] <Riddell> there is a half way between the GUI and command line interfaces 126 [17:46] <Riddell> which is to launch QBzr commands directly from the command line 127 [17:46] <Riddell> so if you're into using command lines but want an easier way to, say, browse a branch history you can run 128 [17:46] <Riddell> bzr qlog 129 [17:46] <Riddell> instead of bzr log 130 [17:46] <Riddell> which will give you a GUi to look at the log 131 [17:47] <Riddell> I use this a lot whenever the history is more complex than straight commits 132 [17:48] <Riddell> the same goes for bzr qcommit or bzr qbranch 133 [17:48] <Riddell> it's a nice alternative for when the command line is showing its limitations 134 [17:48] <ClassBot> dpm asked: are there Bazaar Explorer packages for platforms other than Ubuntu? (e.g. Win, Mac...) 135 [17:49] <Riddell> if you install Bazaaron Windows the installer comes with explorer 136 [17:49] <Riddell> same for Mac I'm sure 137 [17:49] <Riddell> so it's actually the main UI for non-Linux users 138 [17:50] <Riddell> which is why if you follow the Take the Tour link on http://bazaar.canonical.com/en/ it shows you Bazaar Explorer 139 [17:50] <Riddell> that's all I have prepared, any other questions? 140 [17:50] <ClassBot> There are 10 minutes remaining in the current session. 141 [17:51] <ClassBot> bulldog98 asked: will there be a port to freedesktop icon usage? 142 [17:51] <Riddell> I see this is an important issue for you :) 143 [17:52] <Riddell> I think when Bazaar Explorer was started Tango was the obvious choice 144 [17:52] <Riddell> since then Oxygen has come along and the freedesktop icon standard is more available 145 [17:52] <Riddell> but I don't think freedesktop icons are built into Qt so there's a little bit of code needed there 146 [17:53] <Riddell> do file a bug if it's something you want done and hopefully we'll get round to iy 147 [17:53] <Riddell> it 148 [17:53] <ClassBot> 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 149 [17:53] <Riddell> qbzr is the GUi for individual commands 150 [17:53] <Riddell> e.g. bzr qlog 151 [17:54] <Riddell> when you ask Bazaar Explorer to show you the branch log it will run QBzr's qlog 152 [17:54] <Riddell> you can also tell Bazaar Explorer to run bzr-gtk commands instead of QBzr if you really want 153 [17:54] <Riddell> but QBzr is generally better maintained and is the default 154 [17:55] <Riddell> the other main graphical tool is Loggerhead which is the web UI 155 [17:55] <ClassBot> There are 5 minutes remaining in the current session. 156 [17:55] <Riddell> 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 157 [17:56] <Riddell> e.g. Launchpad can now show you a recent changes diff for merge proposals 158 [17:56] <Riddell> there's some other UIs such as my own Dolphin Bazaar plugin for KDE's file manager 159 [17:56] <Riddell> and there's even some experimental integration with Qt Creator 160 [17:57] <ClassBot> bulldog98 asked: is there a graphical way to see my bazaar config, eg what bazaar plugins are run after a commit (cia-client?) 161 [17:57] <Riddell> The settings menu lets you change your Bazaar config 162 [17:58] <Riddell> but it doesn't do everything from a GUI 163 [17:58] <Riddell> User Configuration has your user setup 164 [17:58] <Riddell> but stuff like cia plugin config can only be done with editing a text file for now (Settings -> Locations) 165 [17:59] <Riddell> Bazaar Explorer is extendable so it should be possible for the bzr-cia plugin to add that 166 [17:59] <ClassBot> 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 ? 167 [18:00] <Riddell> it depends where you push them 168 [18:00] <Riddell> if you push them back to where you got it from then it'll be available in the same place 169 [18:00] <Riddell> if you push it to Launchpad it'll be available on Launchpad 170 [18:00] <Riddell> there's no fixed tie in between bzr and Launchpad 171 [18:00] <Riddell> it's just that Launchpad has been designed to work very well with Bazaar 172 || Event: App Developer Week - Current Session: Your App and Launchpad best practices - Instructors: jderose 173 [18:00] <Riddell> time up! 174 [18:00] <dpm> Thanks Riddell for a really awesome session - even with pictures!