Main Contents

Mercurial bulk update

November 14, 2008

I don’t know about you, but I have on a lot of different places a directory called ‘hg’ with lot of different mercurial clones inside. Whether on the home of my several computers for my own projects, or inside other directories for external projects, and so on.

Now, remember one important aspect of distributed source control : your clone is actually both a repository and a working directory. This is why you usually (git and others do the same) have two different commands : one to synchronize the  repository (pull) and one to update the working directory (update).

Updating comes with a risk : you can have conflicts. This is why I never update a svn repository without thinking first (do I have local modifications ?). But pulling is a lot less problematic. And, especially on my laptop, I often want to ’sync them all’ as soon as I have some internet connection. Until now i had a script syncall with the path of all (svn,unison and) mercurial repositories hardcoded. This does not scale, and I now need that in at least 5 different places. I dont feel like maintaining such scripts.

And now comes the magic alias that made my day. I’m usually lame at shell scripting, so I’m sure there are better ways. But it works, now, on my computer. And this is so useful.

alias hgbulk '\ls */.hg -d | cut -d\/ -f1 | xargs -i bash -c  "(cd {}; hg pull )"'

(yes, I use tcsh, but i’ve tested that in bash too. Don’t ask why I use tcsh.)

Filed under: Admin, Gentoo, KDE | Comments (3)

Yet another activity graph : how often do you emerge ?

November 13, 2008

Really, I seem to be fond of activity graphs those days. I have reused part of this previous code, but this time I parse the emerge log file to display the activity of your successful emerges. Think of it as a graphical view of ‘genlop -l’.

Those examples are the emerge activity of my two main computers.

The current code does the bare minimum, and  I need to add at least command line options for

  • logfile to use (currently/default : /var/log/emerge.log)
  • filename to create (currently/default : activity.png)
  • width/height of the image (currently/default : 800×600)

The usage is straightforward:

orzel@berlioz EmergeActivity% ./EmergeActivity.py
There are 9896 emerge completed successfully
Created the file 'activity.png'
orzel@berlioz EmergeActivity% xv activity.png &

You can grab the source (browse, tarballs, mercurial clone, even RSS) from :

http://sources.freehackers.org/hg.cgi/EmergeActivity/

Filed under: Admin, Gentoo | Comments (0)

Full blown kde-aware opale version

November 12, 2008

KDE version of opale

KDE version of opale

Since the release of opale-0.9, I have mostly worked on improving the (optional) KDE integration. And now if KDE is available, opale will use things like : KMainWindow, KApplication (session management..), XML GUI, KFileDialog and specific menu entries (Switch application language, configure shortcuts/toolbars, KDE-aware recent files submenu,…).

While I was there, the Qt-only version now also has a ‘recent files’ dialog popping-up at the start if no file is given on the command line (my personal top-missing feature).

Now, some people noticed that I want to port Opale to the Mac. I have an old ibook lying here, but MacOS has died and I need to re-install it before trying qt/Mac (that I have never tested yet).

As an answer to your blog entry, Orville (I guess that’s your first name, right?):

  • The kde version is now really finished, please try if you want.
  • I guess there’s no menu on the screenshot because Mac still has those on the top of the screen, right ?
  • I would be delighted if you could provide testing on the mac. You can find me on freenode as orzel.
  • I’m also interested with hints about the interface, I’m not afraid of you being mean.
  • What’s the problem with my help menu ? Everything’s fine here. Use the ‘report a bug’ entry in the very same menu!
  • Don’t be scared by a photo :-)

Opale homepage

Project page

Filed under: KDE | Comments (1)

KDE standard aboutbox is kind of close-minded

November 12, 2008

Back in the days of kde3, while writing a KDE application, I encountered quite a big problem while trying to use the aboutbox stuff from KDE (that means kaboutdata and the now called kaboutapplicationdialog). I talked to some guys on #kde-devel, and I have been told that, yes, this will be changed for KDE4.

Now that I (mostly) use and (rarely) develop for KDE4, I have been hit again by the same problem. Before reporting to the bugtracking system of KDE, I would like to know what people think. Most importantly, do people outside of KDE proper do actually use this ?

Description of the problem

There is a field called  bugsEmailAddress in the constructor of KAboutData, which is used by KAboutApplicationDialog to decide what to display. Using this field, something like

"Please report bugs to <a href=\"mailto:%1\">%2</a>.\n"

will be used to display the link in the about box. What does it mean ? First, it means that it is not possible to have a link to a web bug tracker. You need to provide a mail, and nothing else. Seeing how common are web bugtrackers, this is rather strange.

Though… what about KDE’s own applications ? The default value for bugsEmailAddress is “submit@bugs.kde.org”. So far, it makes perfectly sense. But if you open any KDE application, you’ll see a link to the web page. Why is it so ? look in kdelibs/kdeui/dialogs/kaboutapplicationdialog.cpp :

if ( .. || aboutData->bugAddress() == "submit@bugs.kde.org")
     text = "Please use http://bugs.kde.org..."

I can only guess why this was done this way : probably for some historical reason and then nobody bothered about fixing it. I’m sure they have not done something as ugly on purpose.

So as a conclusion

  • KDE uses a link to their web tracker.
  • You are not allowed to such a luxury and you need to provide an email address.

Toward a fix ?

The obvious fix is to store an URL or linkAddress in KAboutData and use that in the About dialog. Adding a clear sentence to the documentation : “if you want to use an email address, just add mailto: in front of the argument”.

Now, instead of ranting, my first reaction was to go and fix that (I swear, trust me). Even few years ago. But.. then I’m confronted to a problem : probably some people use this, and I would break quite a lot of about boxes, and everybody will hate me. Not something I want of course.. I tried to talk about this on IRC, but nobody is really interested in this. And finally, i did not dare changing this, and wend the old way : I wrote my own about box.

Turn around

Today, I have found a way to turn around the problem : You can use the method setCustomAuthorText() and then, KDE will not do anything and let you decide about what to display in this tab. Hourray :-)

Filed under: KDE | Comments (5)

Opale ported to qt4 and kde4

November 11, 2008

Opale was an application written using koffice that I use to handle my personal accounts. Long ago I have dropped support for koffice (mainly because of the crappy/undocumented/buggy chart API) and since then opale was a kde-based application.

One year ago, i have started porting it to kde4, and, meanwhile, made it a Qt4 application. Using configuration, you can now have either a qt4 or a kde4 application. Actually, I have to say the kde4 stuff is not thoroughly tested. Anyway, the qt4 port is done and I now have Opale working under windows. Not that I really care, but that can be useful for others.

It was not until few weeks ago that kde4 was good enough for me (copyright me) so I can actually use this version of opale (yes, I know about running kde4 application under kde3, but no, thanks). Now that this version is tested enough, i release it as 0.9.

The roadmap for 0.10 is

  • macintosh version
  • well-tested kde4 application
  • template editing/removing

Opale homepage

Opale project on freehackers’laboratories.

Filed under: Gentoo, KDE | Comments (4)

Activities gallery

November 2, 2008

While developing my recently released activity mercurial extension (and here too), I did a lot of tests on some quite famous/big projects. I’ve found the results to be quite interesting and decided to put up this gallery. Are you interested in the history of commits for kde, linux, django, portage(software), and others?

warning : this is just for fun (copyright Linus Torvalds), I’m perfectly aware that the number of commits is a very bad indicator for development.

The gallery : http://labs.freehackers.org/wiki/hgactivity/Gallery

Filed under: Admin, Django, Gentoo, KDE, Linux kernel | Comments (2)

Splitted activity for mercurial

October 31, 2008

Today I have added options to the mercurial activity extension and it is now possible the activity displayed for every author. It looks like this :

Filed under: Admin, Gentoo | Comments (1)

Activity extension for mercurial

October 31, 2008

example : activity of the mercurial "crew" repository

example : activity of the mercurial crew repository

This is something i’ve really been missing for long in mercurial : a way to display the activity of a repository. No, ‘hg churn’ is not the right answer, I want an idea of when the peaks of development happened. So I have written this small extension. It is based on matplotlib, so you’ll need that to be installed. It is tested with mercurial 1.0.2 and the current development version of mercurial (so-called mercurial ‘crew’ repository). I’m a big fan of this kind of information, and I’m sure to use this extension regularly, so you can count on it being maintained.

To use is, grab a copy :

hg clone http://sources.freehackers.org/hg.cgi/hgactivity/

and add a line in your ~/.hgrc under [extensions] with the full path to the activity.py (example on my computer, please adapt to your actual path:)

activity=/home/orzel/hg/hgactivity/activity.py

To use it, just do from inside a repository:

hg activity

The first example shows the activity for the mercurial.crew repository, and here’s another one representing the activity of the the ‘kdebase’ module from kde (I have a local mercurial mirror):

Activity of kdebase in the last month

Activity of kdebase during the last month

Homepage of the project: http://labs.freehackers.org/wiki/hgactivity

Filed under: Admin, Gentoo, KDE | Comments (4)

Django browser for Redmine database

September 27, 2008

Do you know redmine ? This is, to my knowledge, the best project manager you could ever find out there. I like to describe it as ‘trac done well‘. It has only one, big, ugly, fat inconvenient for me : it is written on top of ruby on rails. I could tell you how slow it is (true), or how many security flaws are found everyday in the ruby/rails world. But the real reason I’m actually really concerned about ruby/rails is that I don’t know ruby. When I look at the code I don’t understand anything, and I can’t change something to ’suit my needs’, as is so common in Free Software.

I wish it was written in Django.

Well, anyway, I spent some times today to create a small Django application in order to display stuff from the redmine database. For this, I’ve used the wonderful “inspectdb” feature of Django, which access a database and creates the (Django) models required to access it.

Then, I had to ‘adapt’ those models and to create an admin.py file so that I could browse (and even modify) the database from django.

Adapting meant:

  • removing all the “id” field, they are automatically created by Django and it seems rails use the very same name (”id”) so this is compatible.
  • Change the “obvious” references to other model from IntegerField to ForeignKey
  • Some models reference themselves, you need to use a ForeignKey to ’self’ (including quotes) to do that.
  • add some __unicode__(self) for the most important/obvious models

The admin works was basically about:

  • Creates Admin objects for all models (thanks vim’s macro!)
  • add list_display / list_filter args for the most important ones

And the remaining problem is :

  • It seems Boolean from ruby/rails have the values ‘t’/'f’ while those from django have 1/0 (fixed since then)

Mandatory screenshot (corresponding to the public stuff from http://labs.freehackers.org):

Example of djangoredmineadmin in use

Link to the project homepage

Filed under: Admin, Django | Comments (1)

KDE 4.1.2 tagged, gentoo land frozen

September 26, 2008

I’m not a gentoo fan. Mainly because I don’t like the idea of being a ‘fan’. Being a fan in the Free Software world usually means being an extremist and i hate extremism.

I nonetheless use almost exclusively Gentoo on all computers, laptops, servers and other divx boxes I have or maintain. That means a lot of them and it makes my Debian friends laugh. Who cares ? I use Gentoo and Free Software because I find this convenient, and I like the ideas behind them.

Yet I don’t share the optimism of people who think that gentoo is growing. On July 29th, KDE 4.1, the first almost-usable KDE version since the 3.5 branch, has been released, and since then, guess what have happened in the gentoo-KDE land ? Nothing. By nothing I mean first that not a single ebuild, even masked, even hard masked, has reached the official portage tree, and secondly, that despite the huge KDE user base in Gentoo, not a single official statement has been done concerning this issue. Because, believe me or not, there is an actual issue. Nothing was said on the main Gentoo page, almost nothing on gentoo planet (only one post focused on whether KDE should install in a different place or not). In the gentoo land, everybody speaks about everything but KDE in gentoo. Has the meaning of ‘g’ in gentoo recently changed ?

When you try to know a little bit more about this, it’s getting worse. Rumors are that developers have fought each others and the KDE team is just no more. It’s a new KDE team that is here for whatever reason (to which, by the way, I send my very best support, for the development of new ebuilds, for being put under such light/pressure, and for being sent in this lion’s cage that seems to be gentoo devs). I don’t know anything about this, but it’s not the first time I hear about huge tensions between gentoo developers, and this worries me a lot.

I don’t want politics, I want developers, I want Free Software developers. If I wanted politics, I would have gone for Debian, which, by the way, have had packages for KDE 4.1 and 4.1.1 for long.

Growing is not something easy to handle. It seems to me that KDE has managed to do this very well : a lot of work has been done in the few last years to ’scale up’ and I think they managed to do this hugely needed step. Gentoo still has to improve a lot in this area. As a user, my expectations are the same as what you can read everywhere : transparency, transparency and transparency.

I love gentoo, i can understand a lot of things, I can wait, I can deal with human resource shortage, I could even help. I’m used with all of that because that is so common in Free Software and that is part of the deal. But I can’t bear darkness and closeness.

I will not conclude by threatening to leave for another distribution. I’m most than happy with gentoo as a distribution and I will keep on using it as long as it is possible. I have a KDE checkout anyway on my main computer. If things are going worse though, I’m not sure I will dare trying to work on the ebuilds.

I’m ready to ignore the “If you’re not happy with gentoo leave it” type of comments.

Filed under: Gentoo, KDE | Comments (24)