Skip to content

spitfire05/svn-smf-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

svn-smf-hook

Description

Subversion post-commit hook script posting commit info to Simple Machines Forum

You can use this script as post-commit hook of your svn repo, and it'll announce each commit as new topic on selected boards.

Tested to be compatible with Simple Machines Forum 2.0.x

The arguments are the default arguments accepted by svn post-commit hook:

./svn-smf-hook.py /absolute/path/to/your/repo revision

Curent status

Working like a charm.

This script is continously developed, so be sure to check back for updated versions! 😄

Dependencies

All that's needed to run this script is Python 2.6 (or newer) and subversion. No other external dependencies.

Python 3 is not supported atm, though it'd be probably easy to convert the script with 2to3 tool.

Installation

Just download svn-smf-hook.py and svn-smf-hook.conf files and place it in your hooks folder. Then configure the script and run it from post-commit hook.

Example post-commit file

#!/bin/sh

REPO=/aboslute/path/to/your/repo
/usr/bin/env python $REPO/hooks/svn-smf-hook.py $1 $2

Or if you want it to be asynchronous (so the commit operation will not have to wait till posting ends):

#!/bin/sh

REPO=/aboslute/path/to/your/repo
/usr/bin/env python $REPO/hooks/svn-smf-hook.py $1 $2 &

Configuration

Before you deploy this as hook, make sure to properly configure it in svn-smf-hook.conf file. Config options are documented in conf file.

Integration with Project Management Systems

svn-smf-hook features Trac and Redmine integration. You can enable it by setting PMS and PMS_URL config option to the url of your trac/redmine installation.

With PMS integration enabled, the revision number, changed files and all ticket references in commit message (for example: ticket #1234) will be converted into links to their PMS pages.

Supported Project Management Systems and corresponding config values

PMS value what PMS_URL should point to Example
'trac' Root trac address PMS_URL = 'http://trac.myproject.net'
'redmine' Root of the project PMS_URL = 'http://redmine.myproject.org/projects/fooproject'

Note about post-commit hooks

Even though this script features PMS integration, it does not work as post-commit hook refreshing repo status in PMS. To have your tickets in PMS updated on commit, use the PMS svn hook together with this script.

Trac

Read: http://trac.edgewall.org/wiki/TracRepositoryAdmin#Subversion

Personally, I use this Trac hook, and I find it working great. You can even close tickets via commit messages with it.

Redmine

Read: http://www.redmine.org/projects/redmine/wiki/HowTo_setup_automatic_refresh_of_repositories_in_Redmine_on_commit

Integration with other Project Management Systems?

Please fill an issue with request, and I'll probably make it happen 😉

Pull requests are also welcome.

Example forum post

The post produced by this hook will look roughly like this:

=

user_56 made revision 12185 changing the following files:

modified  /trunks/project/readme.txt

with the message:

update readme

=

Credits

The idea for this hook came from similiar hook for another forum software, by [FH]ctz.

About

SVN post-commit hook script posting commit info to Simple Machines Forum

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages