RE: Precommit hook script for Windows. PLS HELP
From: Mike van Hoof <m.vhoof_at_scheepens.nl>
Date: Fri, 4 Jul 2008 14:25:10 +0200
Hi,
Met vriendelijke groet,
Mike van Hoof
Scheepens reclame adviseurs
> Opvallend veelzijdig
________________________________
Van: Uzo okoye [mailto:kejike80_at_hotmail.com]
Hi,
I am a newbie to Subversion and have no clue to writing scripts!!!
I am trying to write a script for windows so that it forces users to add
Now for starters
I want to know if its possible to write the hook script directly as a
Sb helped me write the script in python and in trying to execute it,
I realised that the I don't have the utility SVNLOOK installed , so to
I still get errors. I don't know why.
This is the python script written for the hook and the corresponding
------------------------------------------------------------------------
--- #!/usr/bin/python # commit acceptance python client for SVN import os import re import sys import urlparse # configure svnlook path svnlookPath = '\"C:\\Program Files\\VisualSVN Server\\bin\\svnlook.exe\"' # get committer try: f = os.popen(svnlookPath + ' author -t ' + sys.argv[2] + ' ' + sys.argv[1]) committer = f.read() if f.close(): raise 1 committer = committer.rstrip("\n\r") except: print >> sys.stderr, 'Unable to get committer with svnlook.' print >> sys.stderr, svnlookPath print >> sys.stderr, sys.argv[1] print >> sys.stderr, sys.argv[2] sys.exit(1) # get commit message try: f = os.popen(svnlookPath + ' log -t ' + sys.argv[2] + ' ' + sys.argv[1]) commitMessage = f.read() if f.close(): raise 1 commitMessage = commitMessage.rstrip('\n\r') except: print >> sys.stderr, 'Unable to get commit message with svnlook.' print >> sys.stderr, svnlookPath print >> sys.stderr, sys.argv[1] print >> sys.stderr, sys.argv[2] sys.exit(1) # print arguments # print >> sys.stderr, 'Committer: ' + committer print >> sys.stderr, 'Commit message: "' + commitMessage + '"' if (re.match('^[a-zA-Z]+-[0-9]+([\s]+|$)',commitMessage)): print >> sys.stderr, 'Commit accepted.' sys.exit(0) else: print >> sys.stderr, 'Commit rejected: This repository requires a commit message to begin with a REF issue number.\n\reg REFPRJ-1' sys.exit(1) Commit Error Msg Command: Commit Modified: data\TEST\added2.sql Sending content: data\TEST\added2.sql Error: Commit failed (details follow): Error: Commit blocked by pre-commit hook (exit code 1) with output: Error: Unable to get committer with svnlook. Error: "C:\Program Files\TortoiseSVN\bin\svnlook.exe" Error: C:\data2 Error: 80-1 Finished!: Any help will be appreciated to resolving this. Thanks ... Cast your burdens upon the Lord for He cares for you ... Enough to die for you!!! ________________________________ ________________________________ Get fish-slapping on Messenger! Play Now <http://clk.atdmt.com/UKM/go/101719805/direct/01/>Received on 2008-07-04 14:25:45 CEST |
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.