mtn-browse 0.70 and accompanying Perl monotone library released

Tony Cooper writes on monotone-devel:

I would like to announce the 0.70 release of mtn-browse:

Monotone browser (mtn-browse) is an application for browsing Monotone VCS databases without the need for a workspace. The interface allows one to:

  • Easily select a revision from within a branch
  • Find a revision using complex queries
  • Navigate the contents of a revision using a built in file manager
  • Display file contents, either using the internal viewer or an external helper application
  • Compare the changes between different revisions or versions of a file either using the internal difference viewer or an external application
  • Find files within a revision based on detailed search criteria
  • Display file annotations and easily refer back to the corresponding change documentation
  • Save files to disk
  • Browse remote databases via the netsync protocol
  • Support for Monotone version 0.35 up to 0.47
  • Extensive built in help
  • In English with additional German locale

This version brings many bug fixes and locale support improvements along with support for the newer versions of Monotone. The source can be downloaded from here.

Monotone::AutomateStdio is an object oriented Perl library module that allows Perl applications to easily interface with Monotone’s automate stdio interface. This library supports Monotone versions 0.35
up to and including 0.47. All of the automate stdio functions are available via this library. The source and documentation can be downloaded from here.

Both projects currently support Linux and Mac OS X, but should also work on Solaris and other Unixes. They are considered stable (well at least by me) so let me know if you run into problems.

Keep up the good work, Tony!

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!

Software now patentable in Germany

If you haven’t got the news already: The Federal Court of Justice in Germany recently declared software patentable without any reasonable limitation (German version on news service heise.de here and here).

While there are many efforts in the United States to fix the brokeness of their patent system – also in respect to Software Patents which have made more harm in the last decades than anything else – we here in Europe and especially in Germany are just doing the same mistakes again.

This is a very bad day for the Freeware, Shareware and also the Open Source scene – look out for patent trolls nearby you in the future…

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 🙂

Was ist falsch an diesem Bild?

Auf dem Bild (Quelle: AP) ist zu sehen, wie Abgeordnete des Deutschen Bundestages am heutigen Freitag zur Abstimmung über die 22,4 Mrd. Euro Kredit-Nothilfe für Griechenland schreiten. Ich möchte gar nicht über Sinn und Unsinn dieser Kredite sprechen, nein, ich wundere mich ganz konkret über die in diesem Bild aufgefangene Situation:

Der Deutsche Bundestag beschließt Milliarden-Nothilfen zu Zeiten klammer Kassen, zurückgehender Steuereinnahmen und einer noch nicht vollständig von der letzten Wirtschaftskrise erholten Nation – und die Abgeordneten schreiten lachend und feixend zur Abstimmung über eine noch größere Ausgabenlast…?

Da haben wohl einige die Bodenhaftung gänzlich verloren – nach dem Motto “Ist ja nicht mein Geld…”. Liebe (Noch-)Volksvertreter, wundert Euch nicht, wenn das Volk eines Tages doch mal gewaltig rein Tisch macht.

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.)