[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[TSVN] Re: Bug: Hook script output not captured (Regression?)

From: Laszlo Kishalmi <Laszlo_Kishalmi_at_epam.com>
Date: 2005-10-10 09:34:26 CEST

Stefan Küng wrote:
> Laszlo Kishalmi wrote:
>
>> We are using TortoiseSVN 1.2.4 and it seems the output of the hook
>> script is not captured. (If I remember it was fixed for 1.2.2)
>> The hook output would be the following (From the apache log):
>>
>> An error occurred while committing the transaction. [409, #165001]
>> [Thu Oct 06 17:11:05 2005] [error] [client 10.0.11.144] 'pre-commit'
>> hook failed with error output:\nLog message should be at last 3 word
>> long. [409, #165001]
>
>
> Can't reproduce this. My test hooks return the error message just fine,
> and TSVN shows them to you.
>
> I suggest you check your hook scripts: you *must* write the error
> message to stderr, not stdout.
>
> Stefan
>
We are using the following python script which writes to stderr:

#!/bin/python
#
# This script tests the SVN log message.
#
# Usage: check_msg.py <regexp pattern> <log msg>
#
import sys
import string
import re

def main():

         log_msg = sys.argv[2]
         log_words = string.split(log_msg)
         pattern = sys.argv[1]
         if re.match(pattern, log_msg) == None:
                 sys.stderr.write("Log message doesn't match the
required pattern:\n")
                 sys.stderr.write(pattern)
                 sys.exit(-1)
         if len(log_words) < 3 or log_words[-1] == "***":
                 sys.stderr.write("Log message should be at last 3 word
long.")
                 sys.exit(-1)
         sys.exit(0)

def chomp(s):
         if s[-1:] == '\n': return s[:-1]
         else: return s

main()

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Mon Oct 10 09:43:25 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.