guitone 1.0rc4: we have a winner! (updated)

This fourth release candidate is dedicated to Lena, the Eurovision Song Contest Winner of 2010 :). It comes with a few new nifty features like an improved changeset browser and enhanced certificate support, as well as a couple of other smaller improvements and bugfixes.

The Tarball and a Mac OS X disk image can already be downloaded at the usual location, the Windows installer will follow shortly. [Update: The Windows installer has been added.]

As always, please report bugs if possible. And while guitone now comes with one new translation, Portuguese, thanks to Amรฉrico Monteiro, I’m still looking for more translators – if you’re interested, drop me a note!

Database management made easy

I’ve just merged a new feature to monotone‘s mainline which introduces database management features in the next major version. “Huh, database management? What are you talking about?” you might ask. Well, let me explain:

If you work with monotone you know that it has a strong concept of keeping workspace and repository distinct from each other, unlike for example git, where you can accidentially destroy unpushed changes if you remove your workspace. On the other hand separate databases make monotone workspaces also very lightweight, because checking out a new feature branch is a matter of seconds with an existing database.

Regular monotone users also keep separate projects in separate databases, because that eases the synchronization with other nodes (you don’t have to define complex include / exclude patterns for this then). But they may now face the problem that they have many databases with even more checked out workspaces in different places. Questions like “Uh, have I pulled this already? Where is my workspace again…? What branch is checked out there again…?” may arise – and working with long relative or absolute paths to use the correct database is not easier as well.

Monotone for the rescue! In the upcoming release monotone offers a way to manage regular databases in pre-defined places and allows access to these databases only by giving the file or base name as an argument for the `–database` option. Additionally, a new command `mtn list databases` (or `mtn ls dbs` for short) lists all available databases and shows the known workspaces of these databases.

Give me an example, already!

Lets do an example and create a new project:

$ mtn setup -b my.test.branch test-branch
mtn: initializing new database '/home/thomas/.monotone/databases/default.mtn'

Several things happened here: Just like the `clone` command, `setup` will also create a database if no database is explicitely given, but it will not put this database in the bookkeeping directory as `clone` did in the past versions. Instead, it looks if a default database with the name “default.mtn” (this is configurable via a hook, named `get_default_database_alias`) exists in the first found default location and if not, creates it. Subsequent calls to `setup` and `clone` will use the same database unless otherwise specified.

The default locations where monotone looks for managed databases is configurable through another hook, named `get_default_database_locations`. This hook defaults to `%APPDIR%\monotone\databases` on Windows and `$HOME/.monotone/databases` on Linux.

If you now look at `_MTN/options` of your new workspace, you’ll see that the database option does not contain an absolute path, but a so-called alias which is used by monotone internally to look up the actual location of the database:

$ cat test-branch/_MTN/options
database ":default.mtn"
  branch "my.test.branch"
  keydir "/home/thomas/.monotone/keys"

Aliases always start with a colon and are followed by the name or basename of the database. The following commands are therefor all use the same database:

$ mtn ls branches -d :default.mtn
$ mtn ls branches -d :default
$ mtn ls branches -d ~/.monotone/databases/default.mtn

Where are my workspaces?

Now as promised monotone is also smart about knowing what workspaces you have created for a particular database. Whenever the database option of a workspace is changed, it removes the workspace path from the old database and adds it to the new one.

Lets look at the current output of the new list databases command:

$ mtn ls dbs
:default.mtn (in /home/thomas/.monotone/databases)
    my.test.branch (in /home/thomas/test-branch)

If you want to change the database of the workspace, all you have to do is calling a command which uses a workspace (f.e. `status`) with the new database option:

$ mtn db init -d :test
$ cd test-branch && mtn status -d :test
[... output of mtn status ...]

Now if we check the output of the `list databases` command again, we see the following:

$ mtn ls dbs
:default.mtn (in /home/thomas/.monotone/databases):
        no known valid workspaces
:test.mtn (in /home/thomas/.monotone/databases):
        my.test.branch (in /home/thomas/test-branch)

One thing monotone can’t automatically catch and handle is if you move a workspace within the file system. For this use case, two utility commands have been added, `register_workspace` and `unregister_workspace`:

$ ( cd test-branch && mtn unregister_workspace )
$ mv test-branch my-test-branch
$ ( cd my-test-branch && mtn register_workspace )

Thanks to the manual (de)registration, the output of `list databases` is still correct:

$ mtn ls dbs
:default.mtn (in /home/thomas/.monotone/databases):
        no known valid workspaces
:test.mtn (in /home/thomas/.monotone/databases):
        my.test.branch (in /home/thomas/my-test-branch)

Thats it. I’d love to hear your comments on this new feature. Thanks for reading!

Homebrew package for monotone

Apparently there is a new kid on the block when it comes to package managers / software installers on Mac OS X and its dubbed “Homebrew”.

While I scrolled down their lengthy list of recipes (they call it “formulas”), I recognized that somebody was already so nice and created such a formula for monotone there.

So if you dislike MacPorts or Fink for some reason, you might want to look into Homebrew instead.

Bugfest analysis

The last couple of days have been very busy in the monotone team: A total of 21 bugs have been processed by the attendees of our little bug hunt day and while it was quite stressful for me to keep track and review everything, it was lots of fun. A complete list with references to all the changes can be found here.

I won’t bore you with all the nitty gritty details, instead I show you the highlights that will arrive in the upcoming version 0.48 as fallout of this bugfest:

  • mtn ls tags will be able to show the branch name a tag is on
  • netsync commands will gain a new `–anonymous` option to enforce anonymous pulls and clones
  • a new `undrop` command which recreates formerly dropped files while keeping their contents in-tact
  • head-changing commands like pull, merge, propagate, disapprove and others will get a new `–update` option, which changes an underlying workspace to the new head revision
  • monotone now prints out warnings in a couple of places if you’re about to create divergence, f.e. by disapproving an old revision
  • diff output will now track renames and will also list file deletes

We’re planning to hold off such a bug hunt day or “hackfest” every few months, while keeping the balance between too less and too often. If you’re interested and want to join, drop me a note, idle in monotone’s IRC channel or subscribe to our mailing list. Looking forward to hear from you ๐Ÿ™‚

monotone merchandise / bug hunt day

I recently created a new cafepress shop for monotone which uses the updated logo and our new claim, “reliable, distributed version control” and I have to say that this looks really cool now.

The reason why I did this is not because I’m a greedy bastard (no, the old shop which was set up by Graydon – the original author of monotone – back in 2005 didn’t bought us anything), but because the monotone developers will soon hold off a “Bug Hunt Day” to fix and close many of the old outstanding bugs we still have in the Savannah bug tracker. And what is better then bribing the devs with cool merchandise they’re receiving when they close more bugs than others…?

So if you want one of those cool caps, mugs or t-shirts, you have two options – either go directly to the shop and order one of the listed products there (and support your beloved version control tool :)) or you attend our little bug hunting – for the latter just go to this doodle survey and add your name and possible dates when you’re available.

Subscribing to monotone’s development list or idling around in our IRC channel might be helpful as well… I would be pleased to see you there!

Quitting a Qt application from the Mac OS X dock

So for some weird reason my application was not closable from the Mac OS X dock – it quit properly when you selected “Quit” from the application menu or hit the Cmd-Q shortcut – but the dock menu’s quit action was completely ignored.

While debugging the issue I hooked into `QApplication::notify(QObject *, QEvent *)` and noted that a `QCloseEvent` was send to my application… wait, what? A `QCloseEvent`? Yes, I also thought that these kinds of events would only be send to widgets, namely, top level widgets, but I got one for my application, and Qt plainly ignored it. So I went further ahead and tried to quit the application directly when the event occured, similar to this

bool MyApp::event(QEvent * ev)
{
    bool eaten = false;
    switch (ev->type())
    {
        // other stuff ...
#ifdef Q_WS_MAC:
        case QEvent::Close:
        {
            quit();
            eaten = true;
            break;
        }
#endif
        default:
            eaten = QCoreApplication::event(ev);
            break;
    }
    return eaten;
}

but this didn’t work out so nicely: while the application quitted correctly, the `quit()` slot was apparently called twice in a row. My guess is that Qt ignores the `quitOnLastWindowClosed` property – which I’ve set to false – and since I close all windows in the quit slot it executes quit again, or something else, so I decided to just close all open windows when the `QCloseEvent` arrived – without calling `quit()` directly, and tada, my application quitted and the slot was also only called once. (This was a mistake on my side because I missed a break.)

monotone plugin for indefero (updated)

I’ve started hacking on a monotone plugin for indefero – a source code / project management tool which supports various SCM backends. You can find the code for it on github (git, because, well, indefero uses git…).

While there are a couple of web-related tools for monotone, namely TracMonotone and ViewMTN, both projects haven’t seen many updates over the last couple of years and are now even maintained by a single person who has not much time either. Having very good and broad tool support is however crucial for an SCM system, because only very few people are willing to use the command line for everything, so I hope that the addition of indefero as tool which will support monotone in one of its next versions will help both projects a little.

The code is still in alpha state, but one can already browse branches and revisions. My current TODO is as follows:

  • finalize the implementation of the changelog view done
  • make branch names shorter in the UI so they don’t overlap with the tree contents done
  • add automate stdio support for the SCM backend class, so we don’t need to create a separate process for every data request done
  • add automate remote_stdio support (possibly by adding a configuration option which allows either setup)
  • truncate the log message in the tree view to a proper size
  • dynamically change the clone url to the branch which the user is currently browsing done
  • check the inTags() and inBranch() implementations – apparently this does not work as it should done

Especially the multi-project nature of indefero requires some additional hacks in monotone and also one of its tools, usher (which is able to serve multiple distinct databases over one connection), so this plugin project really drives a lot of development. If you’re interested in either part and want to team up, drop me a note ๐Ÿ˜‰

guitone 1.0rc3 released

I’m proud to announce the third release candidate of guitone 1.0.
This release fixes some critical bugs and also adds support for
drag’n’drop renames in the workspace amongst other minor improvements.

The complete list of changes is as always listed in NEWS. A Mac OS X
binary is also already available, a package for Windows will follow
tomorrow.

I’m still looking for translators – if you’re interested, please drop me
a note.

openSUSE build service automation

A few weeks ago I’ve hacked together some scripts to use the openSUSE build service as platform for nightly builds. The build is kicked off every hour when something new can be build.

Additionally I’ve created a small PHP client which queries the openSUSE RESTful API and shows packages, binaries, the build log of the last build and a build history.

The code for this is GPL’d and can be cloned via monotone:

$ mtn clone thomaskeller.biz biz.thomaskeller.monotone-nightly

All this could be polished and secured quite a bit more and its even arguable if its a good idea to “misuse” the openSUSE’s infrastructure
for nightly builds like this, but I see it more as a proof of concept. Since their build infrastructure code is open source as well, somebody
can always just setup a build server together with a service and a couple of predefined XEN images and should be good to go.

The concept can now be horizontally applied to other distros and versions as well, basically anything what can run within a Xen instance
(unfortunately this does not include Mac OS X or Windows, so there is still the need for some kind of alternative build infrastructure). I
eventually plan to add a couple of more Xen instances to my project and try to get them build – of course you can be my guest and play with it yourself and lend me a helping hand here ๐Ÿ™‚

guitone 1.0rc2 released

I’m proud to announce the immediate release of guitone-1.0rc2. This is the second release in a series of smaller releases which aims at the stabilization of the guitone codebase. A lot of bug fixes went into the code, only a few outstanding issues remain. The addition of an
annotation view is the most visible new feature of this release. Please test and report bugs if possible.

The complete list of changes is written down in the NEWS file as
always. I’ll try and prepare a Windows binary tomorrow, a binary for Mac OS X should arrive shortly as well.