The Semb + Wever Family
[ start | index | login ]
start > java > Integrating Subversion and S

Integrating Subversion and S

Created by michaelwever. Last edited by michaelwever, 9 years and 195 days ago. Viewed 9,053 times. #11
[diff] [history] [edit] [rdf]



You need
  • to copy extensions/scripts/ into your subversion repository's hooks directory,
  • python with >>xmlrpclib and svn libraries (ie the bindings),
If subversion and scarab will run on seperate machines, you need to:
  • check the firewall (outbound-traffic) is open to the machine running your scarab installation to the defined xmlrpc port (the default is 12345),


If subversion and scarab will run on seperate machines, you need to:
  • edit src/conf/conf/componentConfiguration.xml so that in <XmlRpcComponent> the element <acceptedClients clientIP=""/> allows the ipaddress of your subversion machine to connect. (This is also the file to edit if you want to change the port scarab's xmlrpc is running on). Scarab will need to be rebuilt and restarted after these changes,
  • check the firewall (inbound-traffic) is open from the machine running your subversion installation on the defined xmlrpc port (the default is 12345).

Checking Prerequisites

  • From your subversion repository's hooks directory running the script should give the output:
user@subversion$ ./
Publish Subversion commits into to Scarab.
If this doesn't work then you need to check the python libraries are installed correctly.
  • After restarting Scarab, check scarab/logs/scarab.log contains:
[main] INFO  org.tigris.scarab.util.SimpleHandler - SimpleHandler: loading
If this is missing, then look closer at the turbine.log to see if the XmlRpc component is being properly initialised. It'll all look something like:
[main] INFO  ...DefaultXmlRpcServerComponent - Attempting to initialize the XML-RPC server.
[main] INFO  ...DefaultXmlRpcServerComponent - We have 1 handlers to configure.
[main] INFO  ...DefaultXmlRpcServerComponent - registered: simple with class: org.tigris.scarab.util.SimpleHandler
[main] INFO  ...DefaultXmlRpcServerComponent - Operating in a state of paranoia
[main] INFO  ...DefaultXmlRpcServerComponent - Accepting client ->
If this doesn't help then you will atleast have useful information to post to to get further help with.
Note: Or should it be ? I've presumed configuring Turbine/Yaafi components within scarab is more dev than user...


The only setup needed, beyond checking the prequisites, is a few variables in the and finally calling this script from variables

There are two sections of variables in the beginning of the script, "basic configuration" and "i18n strings". We are only interested in the former, the latter is only when you want to localise the output to another language.
  1. VIEWCVS_URL = ""
    The viewcvs or websvn URL base. The comments posted to scarab contain a list of hyperlinks to the diffs committed in that subversion transaction. This is the base URL prepended to those hyperlinks.
  2. SCARAB_XMLRPC_URL = "http://localhost:12345"
    The address of the scarab machine and port running the xmlrpc service. If scarab and subversion are running on the same machine it is sufficient to use the above.
    Each time a comment is added to an issue in scarab by default an email is sent to everyone associated to the issue. The author of the integration didn't feel it was appropriate that all associated personnel were notified of every commit. Especially since the commit will often be followed by a manual change by the commitor of the status attribute to the issue in question, and associated personnel are more interested in these events. But if this is not the case for you change the variable to 0.
NOTE Only the global setting of email-enabled is checked (and temporarily disabled), so if your modules override this setting emails will continued to be sent. See >> for more… (This will be fixed in the future).


In your subversion repository's hooks directory, append to the file post-commit
# Call Scarab integration
cd <your-repository>/hooks/
./ $REPO $REV >> post-commit.log 2>&1
If the file doesn't exist, create it from a copy of post-commit.tmpl, and remove the last two lines before appending the above.
Note: it's important to background the call to to prevent blocking of subversion while xmlrpc tries to connect and communicates with scarab…

When it's working

When its working look in target/scarab/logs/scarab.log The output should be similar to
2005-09-03 14:59:31,855 [Thread-9] INFO  org.tigris.scarab.util.SimpleHandler - SimpleHandler: addComment:  issues=SMBW1657 test commit, user=mick, comment="Subversion commit 6011:    h ttp://samboweb/viewcvs/?view=rev&rev=6011
SMBW1657 test commit
Modified: trunk/build.xml    h ttp://samboweb/viewcvs/trunk/build.xml?view=diff&rev=6011&p1=trunk/build.xml&r1=6010&p2=trunk/build.xml&r2=6011
, disableEmails=1

Subversion -to- Scarab Username mappings

This part of the integration is still primitive. By far the best solution is to enforce subversion and scarab usernames are the same, either manually or via using a LDAP service. If this is not the case, the currently primitive solution is to enter the mapping relationships manually into An example already exists commented under "### Do any Subversion-to-Scarab author mappings here ###".
!! The author would like anyone with python experience to separate this mapping into a separate python script that can be easily called if it is present, so that updating is less error-prone !!
See >> for more...


The scarab subversion integration was inspired and based upon work originally done by Rob Clark.
Next to all of the was done by C.Michael Pilato, also the author of the subversion-python bindings.
no comments | post comment
Describe here what your SnipSnap is about!

Configure this box!

  1. Login in
  2. Click here: snipsnap-portlet-2
  3. Edit this box

>>The only thing worse than using cracked/stolen software is actually paying for it.
>>Liberate yourself. Free Software Foundation.

XHTML 1.0 validated CSS validated RSS 2.0 validated SnipSnap Get Firefox! RSS Feed
Powered by Gentoo Linux/GNU

Rainforest Site