Mercurial/Trac Changeset Hook

Below is a Mecurial changegroup hook to modify tickets on a remote Trac instance using XML-RPC. To useit, place the following in your hgrc (make necessary changes in [trac-hook] section). File: repo/.hg/hgrc [extensions] trac_hg_hook = /path/to/trac_hg_hook.py [hooks] changegroup.sync = python:trac_hg_hook.hook [trac-hook] trac_root = /var/lib/trac api_url = https://trac_user:[email protected]/xmlrpc repo_name = test python_eggs = ‘/var/www/.python-eggs/’ The hook […]



Reorder all fields in Trac

We decided to add a business justification field to our Trac instance today, but needed to put it directly below the description field so that it was in a more logical position for the users. It is not possible to intermingle custom ticket fields with standard ones (from within Trac), so editing the ticket template […]


Finding The Geometric Mean In Python

Geometric means are a quick and easy way to benchmark system/interpreter performance. The below function is an example of calculating geometric averages in Python: def geometric_mean(nums):     ”’         Return the geometric average of nums         @param    list    nums    List of nums to avg   […]


Compiling PyPy From Source

PyPy is significantly faster when compared against the default CPython interpreter. For the most part, this interpreter functions the same way that CPython does, and most libraries will run with no issues. In my testing, PyPy was 5-10 times faster than CPython and I was able to install/use every library other than PyQt4 and Trac. […]