QCT - Back in Action

Posted by dave
on Friday, November 20

Ubuntu releases with broken versions of the QCT Commit Tool appear to be something of a tradition, and Ubuntu 9.10 (Karmic Koala) is no exception. Qct is an easy to use, very lightweight commit tool which I always find myself reaching for when doing commits these days, and I go a bit mental when I need to use subversion and it’s not around. Anway, to the problem:

chimp@boomer:~/workspace/projectname $ qct
Auto-detected Subversion repository

Qct fires up, I type in a commit message, and select which files I want to commit. Everything looks good until we hit the “commit” button:

Error code 1 not expected
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/qctlib/gui_logic.py", line 801, in commitSelected
    self.vcs.commitFiles(checkedItemList, msg)
  File "/usr/lib/pymodules/python2.6/qctlib/vcs/svn.py", line 231, in commitFiles
    runProgram([self.svn_exe, 'commit', '-F', filename] + commitFileNames)
  File "/usr/lib/pymodules/python2.6/qctlib/utils.py", line 143, in runProgram
    raise ProgramError(progStr, out)
qctlib.utils.ProgramError: svn commit -F /tmp/tmpChpKyU  app/controllers/application_controller.rb: svn: '/home/chimp/workspace/projectname/ app/controllers' is not a working copy
svn: '/home/chimp/workspace/projectname/ app/controllers' does not exist

Note the space between projectname and app. An older version of qct is not loving the new subversion 1.6 in Ubuntu, which brings some new options with it. Ok, time for the source tarball off of http://qct.sourceforge.net. To compile it, you’ll need to sudo apt-get install pyqt4-dev-tools, then cd into the source directory and run sudo make site-install to install it system-wide. Did you do that? Bad news for not reading ahead, because attempting to use that qct binary gets you:

chimp@boomer:~/workspace/projectname$ qct
Traceback (most recent call last):
  File "/usr/local/bin/qct", line 13, in <module>
    from qctlib.gui_logic import CommitTool
  File "/usr/local/lib/python2.6/dist-packages/qctlib/gui_logic.py", line 9, in <module>
    from qctlib.ui_dialog import Ui_commitToolDialog
ImportError: cannot import name Ui_commitToolDialog

So, that one doesn’t even fire up.

Lastly, I grabbed the latest source for the project:

sudo apt-get install mercurial  pyqt4-dev-tools
hg clone http://bitbucket.org/sborho/qct/
cd qct
sudo make site-install

Don’t forget to apt-get install pyqt4-dev-tools first, or that’ll blow.

The latest source appears to work fine, very many thanks to the author Steve Borho for this great little tool.

Patching the QCT Commit Tool

Posted by dave
on Thursday, October 01

The qct commit tool is a very nice lightweight svn client, but in the standard Ubuntu 9.04 repos it suffers from one small flaw: it doesn’t actually work. This patch (stolen from upstream) gets it back in working order:

for line in recs:
   if len(line) < 7: # <== add that
       continue # <== and that
   status = line[0]
   fname = line[7:]

Drop those two changed lines into /usr/share/python-support/qct/qctlib/vcs/svn.py after line 93 and you’ll have a nice lightweight svn commit tool.