#!/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)
You need to create an account or log in to post comments to this site.
Related Posts
» Clean Textpattern install fr... in installation textpattern svn
» Forcing an SVN export to ove... in svn export force sitemanagement
» Add all new files to svn rep... in svn
» Recursively remove all .svn ... in shell svn bash
» knowning how many commits it... in svn subversion
» Finding files to be added in svn subversion
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails