#!/usr/local/bin/python """ Subversion pre-commit hook which currently checks that the commit contains a commit message to avoid commiting empty changesets which tortoisesvn seems to have a habbit of committing. Based on http://svn.collab.net/repos/svn/branches/1.2.x/contrib/hook-scripts/commit-block-joke.py and hooks/pre-commit.tmpl Hacked together by Jacques Marneweck <jacques@php.net> $Id$ """ import sys, os, string SVNLOOK='/usr/local/bin/svnlook' def main(repos, txn): log_cmd = '%s log -t "%s" "%s"' % (SVNLOOK, txn, repos) log_msg = os.popen(log_cmd, 'r').readline().rstrip('\n') if len(log_msg) < 10: sys.stderr.write ("Please enter a commit message which details what has changed during this commit.\n") sys.exit(1) else: sys.exit(0) if __name__ == '__main__': if len(sys.argv) < 3: sys.stderr.write("Usage: %s REPOS TXN\n" % (sys.argv[0])) else: main(sys.argv[1], sys.argv[2])
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Using a pre-commit script (written in python) (See related posts)
Comments on this post
In Windows, the txn and repos need to be switched.
You can see this is you print out the repos, txn, and log_msg values as part of your error message.
log_msg will be blank.
then take the values printed out, and try running the SVNLOOK command from the cmd windows.
With txn first, you'll see the error message.
Hope this helps.
You need to create an account or log in to post comments to this site.
Related Posts
» PHP Update Registo in php suexec spam sysadmin ssh locking pw perl svn svnnotify pre-commit mod_php macosx htaccess darcs dom expressionengine textdrive breakfast unix valid udf flash8 feeds rss database c netperf XSL image migration recursive rmagick validation event timestamp mssql link io uploading music autoit update geektool bind pmwiki ui pivot statistics video microsoft alter facebook decode datetime only rar freeze smb macports socks launchagent hidden xpath PowerShell ansi options disable networksetup getopt pipestatus rule isql service quote packagemaker stdin free iphone wildcard xdev bin radix copycover delicious close avi decimal redirection pinboard resolution load directories fill conver CaptchaAuth fifo extension bold absh printerStatus bubble realtime Registo
» PHP Borrar Registro in php suexec spam sysadmin ssh locking pw perl svn svnnotify pre-commit mod_php macosx htaccess darcs dom expressionengine textdrive breakfast unix valid udf flash8 feeds rss database c netperf XSL image migration recursive rmagick validation event timestamp mssql link io uploading music autoit geektool bind pmwiki ui pivot statistics video microsoft alter facebook decode datetime only rar freeze smb macports socks launchagent hidden xpath PowerShell ansi options disable networksetup getopt pipestatus rule isql service quote packagemaker stdin free iphone wildcard xdev bin radix copycover delicious close avi decimal redirection pinboard resolution load directories fill conver CaptchaAuth fifo extension bold absh printerStatus bubble realtime Registro Borrar
» top-bottom bordering in suexec spam sysadmin ssh locking pw perl svn svnnotify pre-commit mod_php macosx htaccess darcs dom expressionengine textdrive breakfast unix valid udf flash8 feeds rss database c netperf XSL image migration recursive rmagick validation event timestamp mssql link io uploading music autoit geektool bind pmwiki ui pivot statistics video microsoft alter facebook decode datetime only rar freeze smb macports socks launchagent hidden xpath PowerShell ansi options disable networksetup getopt pipestatus rule isql service quote packagemaker stdin free iphone wildcard xdev bin radix copycover delicious close avi decimal redirection pinboard resolution load directories fill conver CaptchaAuth fifo extension bold absh printerStatus bubble realtime top-bottom bordering
» Wordpress - Remove the Fn Ad... in suexec spam sysadmin ssh locking pw perl svn wordpress svnnotify pre-commit mod_php macosx htaccess darcs dom expressionengine textdrive breakfast unix valid udf flash8 feeds rss database c netperf XSL image migration recursive rmagick validation event timestamp mssql link io uploading music autoit geektool bind pmwiki ui pivot statistics video microsoft alter facebook decode datetime only rar freeze smb macports remove socks launchagent hidden admin xpath PowerShell bar ansi options disable networksetup getopt pipestatus rule isql service quote packagemaker stdin free iphone wildcard xdev bin radix copycover delicious The fn close avi decimal redirection pinboard resolution load directories fill conver CaptchaAuth fifo extension bold absh printerStatus bubble realtime
» CSS - rounded corners in suexec spam sysadmin ssh locking pw perl svn css svnnotify pre-commit mod_php macosx htaccess darcs dom expressionengine textdrive breakfast unix valid udf flash8 feeds rss database c netperf XSL image migration recursive rmagick validation event timestamp mssql link io uploading music autoit geektool bind pmwiki ui pivot statistics video microsoft alter facebook decode datetime only rar freeze smb macports socks launchagent hidden xpath PowerShell ansi options disable networksetup getopt pipestatus rule isql service quote packagemaker stdin free iphone wildcard xdev bin radix copycover delicious close avi decimal redirection pinboard resolution load directories fill conver CaptchaAuth fifo extension bold absh printerStatus bubble realtime corners Rounded
» jQuery simple checkbox list in suexec spam sysadmin ssh locking pw perl svn svnnotify pre-commit mod_php macosx htaccess darcs dom expressionengine textdrive breakfast unix valid udf checkbox flash8 feeds rss database c netperf XSL image migration recursive rmagick validation event timestamp mssql link io uploading music autoit geektool jquery list simple bind pmwiki ui pivot statistics video microsoft alter facebook decode datetime only rar freeze smb macports socks launchagent hidden xpath PowerShell ansi options disable networksetup getopt pipestatus rule isql service quote packagemaker stdin free iphone wildcard xdev bin radix copycover delicious close avi decimal redirection pinboard resolution load directories fill conver CaptchaAuth fifo extension bold absh printerStatus bubble realtime
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails
log_msg is always empty.
pre-commit.bat
pre-commit.py