Bzr vs SVN

I wanted to rewrite Mango in Python for a while now, but couldn’t determine which framework to use. Mostly as these frameworks either do way too much or just not enough. Shaunm (and some others in #gnome-hackers) was so nice to convince me that Django was a really good framework. This as I hate frameworks. I want to ignore most of it. My basic needs were CSRF protection (not that I cannot do it myself, but I want to ensure they’ve thought about security), session, something like fastcgi/scgi (the Mango Python stuff needs to run under a different user) and templates etc should be optional.

For the rewrite I’ve decided to use the Bzr mirror. This while still publishing the branch on and having the ability to merge both ways (from trunk to django and django to trunk.. at one point). The initial setup for the tools I needed took some time, hopefully this will be resolved soon. This as Mandriva doesn’t have a bzr-svn package yet. I started off with bzr-svn.

Installing bzr-svn is pretty easy (only needed to push to, pulling can be done via bzr-mirror):

mkdir -p ~/.bazaar/plugins/
cd ~/.bazaar/plugins
bzr branch svn

However, that plugin wants the right Subversion version and 1.5 wasn’t packaged for Mandriva Cooker yet. Compiling Subversion failed initially, as it somehow wanted to link to the installed subversion libraries (this while I did not have the 1.4 svn devel package installed). After I figured that out, there was another issue as the Subversion API changed with 1.5. The workaround for now is to remove the assertion on line 944 in subversion/libsvn_ra/ra_loader.c (or wait for the new bzr-svn plugin).

After getting the tools working, the rest is a bit magical. I followed the GNOME Bazaar instructions and branched Mango trunk locally in a django branch. A bzr push svn+ssh:// would be enough to push it back to GNOME (you need to specify the push URL once). However, I wanted a branch in SVN. The push command currently (?) will not create new branches, but there is a svn-push which does.

The command I used to create the new ‘upstream’ branch was:

$ bzr svn-push svn+ssh://

The result from svn-commits-list:

Author: ovitters
Date: Sat Jun 21 17:58:09 2008
New Revision: 205

        Try and port the mess to Python using the Django framework.
        * .bzrignore: Ignore the django directory.
        * mango/ Standard Django script to manage the Django
                * mango/ Describes the Database (needs a bit of work).
        * mango/ Django settings and the config.xml file.
        * mango/ Maps URLs to functions which will be called.
        * mango/ Handles turning an http request into an http
        response (application/xml).

   branches/django/   (props changed)
      - copied from r204, /trunk/
   branches/django/mango/   (contents, props changed)

From above email it is clear it copied (branched) the trunk and not just put new files into that Django branch. The resulting test Django installation works pretty similar as the current PHP Mango version:

Oh, and some way too early screenshots:
Current trunk (PHP)
Mango PHP trunk

Django branch
Mango Django branch

It seems nice, but that is just because I am sharing the XSLT templates. It doesn’t do anything useful yet. For instance, you can clearly see the missing ‘tabs’ and that it doesn’t filter the account requests. A Django LDAP model would also be nice (has a really nice abstraction for models), but was designed with database in mind unfortunately.

5 Replies to “Bzr vs SVN”

  1. Christian: Mango is a frontend to edit GNOME LDAP (new users in LDAP, ssh keys, etc). Authentication is not enough.. although I’ll look at it… better to reuse than to invent myself.

    One of the reasons for moving to Python (apart from hating PHP while being the only active developer), is that I want to make authentication possible using the SSH keys in LDAP. Which will require a custom authentication method ;)

  2. If you would be interested in additional pair of hands and a head, I could help you with Python/Django coding.

    Great to hear Gnome is using Django too :)

  3. I had a brief look at writing an LDAP model for Django, but lots of things worked by munging SQL statements and I cbf reimplementing them all.

Comments are closed.