Creating a branch/tag through the PHP SVN API

Submitted by Jochus on Thu, 29/07/2010 - 00:15 | Posted in: Drupal
Posted in


We are currently working on Drupal modules which are versioned in Subversion. We often make new releases and for every release, we also create tags in SVN. In Java, there's a tool called Maven which has a "release plugin". This plugin helps you releasing.

Drupal doesn't have this tool, so we are creating a "release management tool" which does the same for us. We simply specify the module we want to release. The stable version is introduced and the new version is proposed. Creating tags happens now automatically using the PHP SVN API. More details can be found here: http://php.net/manual/en/book.svn.php.

However, it took me some time to understand the API, as it's not very well documented. I even wasn't able to find a perfect example on the internet.

$svn_repos = svn_repos_open("##PATH_TO_REPO##");
$svn_fs = svn_repos_fs($svn_repos);
 
// init 'from' resource
$svn_fs_root = svn_fs_revision_root($svn_fs, svn_fs_youngest_rev($svn_fs));
 
// init 'to' resource
$svn_tx = svn_fs_begin_txn2($svn_fs, svn_fs_youngest_rev($svn_fs));
$svn_tx_root = svn_fs_txn_root($svn_tx);
 
// execute copy command
svn_fs_copy( $svn_fs_root,  "##FROM_PATH##",  $svn_tx_root, "##TO_PATH##");
 
// commit
svn_repos_fs_commit_txn($svn_tx);

Changing GTK bookmarks

Submitted by Jochus on Tue, 27/07/2010 - 00:47 | Posted in: Linux
Posted in


Ever wondered how to change or add bookmarks using commandline? Well, it's very easy :-):

<a href="mailto:jochen@DESKTOP">jochen@DESKTOP</a>-JOCHEN ~ $ ls -al .gtk-bookmarks 
-rw-r--r-- 1 jochen jochen 339 2010-07-27 09:34 .gtk-bookmarks
<a href="mailto:jochen@DESKTOP">jochen@DESKTOP</a>-JOCHEN ~ $ cat .gtk-bookmarks 
file:///home/jochen/Documents
file:///home/jochen/Music
file:///home/jochen/Pictures
file:///home/jochen/Videos
file:///home/jochen/Downloads

Trac ... equivalent for Atlassian products?!

Submitted by Jochus on Mon, 26/07/2010 - 00:53 | Posted in:


As some of you know, I'm a big fan of the Atlassian products as JIRA, Confluence, Bamboo, Crucible, ... etc, etc, ... The big disavantage to this tool, is the cost of the product. It's not free ... and for small companies, not always easy to integrate in their IT system.

So I have been looking a while to find a free alternative, and I think I found it: it's called => Trac ( http://trac.edgewall.org/ ).

Short introduction:


Trac is an enhanced wiki and issue tracking system for software development projects. Trac uses a minimalistic approach to web-based software project management. Our mission is to help developers write great software while staying out of the way. Trac should impose as little as possible on a team's established development process and policies.

It provides an interface to Subversion (or other version control systems), an integrated Wiki and convenient reporting facilities.

Trac allows wiki markup in issue descriptions and commit messages, creating links and seamless references between bugs, tasks, changesets, files and wiki pages. A timeline shows all current and past project events in order, making the acquisition of an overview of the project and tracking progress very easy.


The tool is written in Python and works like a charm. I can do everything with it, as with the Atlassian tools (for wiki and ticketing stuff I mean). Also, notice this repository: http://trac-hacks.org/. A lot of open source community developers are contributing nice plugins!

We are currently using:

  • TicketImport: for the migration of Excel files to our ticketing system
  • AgiloForScrumPlugin: an agile/scrum plugin, which we use to organize our sprints
  • TracTicketChanges: scans the SCM commits => when a ticket number is found in the log message, a link will be created from the ticketing system to the source repository

Give it a try and enjoy :-) !!!

GIT vs SVN

Submitted by Jochus on Tue, 20/07/2010 - 00:53 | Posted in: Linux
Posted in

Last week, I did a comparison between the upcoming SCM package: GIT (http://git-scm.com/) and SVN (http://subversion.tigris.org/). We are planning to switch to GIT, but we wanted to make sure it should be useful to switch.

In my opinion, these are the advantages:

ADVANTAGES

  • with GIT, you're moving from a centralized architecture to a distributed architecture. This means we can easily create GIT repositories all over the world and merge them with very commands. It's not necessary to be connected to one single SCM server. You can get data from other repositories using the pull commando, or you can push your data to the other repository
  • it's so much easier/faster to branch and merge
  • it's so easy to create a local repository and to start working. I even tried ViewGIT (http://viewgit.sourceforge.net/) which is a repository browser. The installation & configuration was made in just 5 minutes work
  • there's no sh*t about every folder having a .svn folder ... the root folder contains a .git folder, and that's it :-)
  • commands are executing very fast



DISADVANTAGES

  • working with a distributed architecture seems nice. But in my company, we only need the client/server model. So every time we want to commit something, we have to:
    • add the file to the local repo
    • commit the file to the local repo
    • push the new revisions to the central repo
  • working with a centralized architecture seems to be going faster
    • add the file to the central repo
    • commit the file to the central repo
  • I tried setting up a central repository http://gitorious.org/, but I had a lot of trouble configuring it on Ubuntu. It really looks nice, but I wasn't convinced the central repo was working fine
  • SSH keys are needed to commit to the central repository ... which is great for Linux users, but you need some extra configuration for Windows clients
  • GIT is not fully supported in certain IDE's, or Ubuntu packages, etc, ...


MY CONCLUSION
GIT is so cool! But I'm not convinced to switch now from SVN to GIT. All developers will need an extra training, but I can't really find the advantage to switch.
But, I'm pretty much convinced GIT is nice for teams/projects were developers are located everywhere in the world ...

Disabling MySQL on startup Ubuntu

Submitted by Jochus on Sun, 18/07/2010 - 23:55 | Posted in: Linux
Posted in

I was looking for a way to NOT startup MySQL on my Ubuntu machine, while booting the system.
In previous versions, this could be easily done with the rcconf tool. I'm using Ubuntu 10.04 (LTS - Lucid) now. But this was the result with rcconf in Ubuntu Lucid (10.04 LTS):






So MySQL was starting up, every time at boot time, but the rcconf tool was telling me : "hey, MySQL doesn't start up at boot time!".

After Googling a while, I found out that MySQL is now starting up by upstart (http://upstart.ubuntu.com/). In order to disable MySQL, execute following steps:

<a href="mailto:jochen@DESKTOP">jochen@DESKTOP</a>-JOCHEN ~ $ sudo nano /etc/init/mysql.conf

Now comment the lines marked with "<-------"

# MySQL Service

description "MySQL Server"
author "Mario Limonciello "

# start on (net-device-up <-------
# and local-filesystems) <-------


Reboot your system to test :-) !

Useful bash operations on JAR files

Submitted by Jochus on Wed, 16/06/2010 - 14:06 | Posted in: Linux
Posted in

Today, a colleague of me teached me some useful commands to execute operations on JAR files

Searching for a class file in a bunch of JAR files

I needed this, as I was looking for a class in the lib folder of JBoss. The lib folder contains a lot of JAR files, so it was rather impossible to search them individually:

<a href="mailto:jochen@baileys">jochen@baileys</a> lib $ grep -ri TreeCacheProvider .
Binary file ./jboss-hibernate.jar matches
Binary file ./hibernate3.jar matches
Binary file ./hibernate-jbosscache-3.3.2.GA.jar matches

Searching for the full package name of a class in a JAR file

Ok, so with the command above, I know TreeCacheProvider is in 3 JAR files, but I want to know the full qualified package name?

<a href="mailto:jochen@baileys">jochen@baileys</a> lib $ jar tvf jboss-hibernate.jar | grep TreeCacheProvider
  3232 Fri Jul 18 14:20:44 CEST 2008 org/jboss/hibernate/cache/DeployedTreeCacheProvider.class

Unable to send HTML formatted e-mails with Evolution in Ubuntu Karmic Koala (9.10)

Submitted by Jochus on Wed, 16/06/2010 - 08:53 | Posted in: Linux
Posted in


I've been using Evolution for a while now, together with the evolution-mapi plugin. The combination of the 2 packages, makes it possible to have a fully equivalent e-mail/agenda client as Outlook on your Ubuntu/Linux system. In this way, you can easily receive/send mails from M$ Exchange, get a list of all the people you can mail (~ addressbook :p), get your calendar, etc, etc, ...

Sounds great, but I have to say I'm having a small issue: I'm not able to send mails to my colleagues in HTML format :-( ... I didn't find the time to search for the issue, until today. I came across this bug: https://bugs.launchpad.net/evolution-mapi/+bug/361991. Bad luck for me, as the bug isn't fixed yet :-( ... So I'll hope they'll get it soon into their next release!

2010-04-14 16:29:03 Clint Foster nominated for series evolution-mapi/trunk