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

Re: calling a custoom perl script from pre-commit hook

From: David Weintraub <qazwart_at_gmail.com>
Date: Wed, 29 Sep 2010 09:18:56 -0400

On Tue, Sep 28, 2010 at 8:38 PM, Charan <charan314_at_gmail.com> wrote:
> Hi Guys,
> I have prepared my own custom perl script to check for logs and spaces in
> file names but when I call the perl script from pre-commit hook, I'm seeing
> the below error. Any suggestions from you?
> svnlook: Can't open file 'format': No such file or directory

What is the repository directory you're passing to the "svnlook"
command? Remember this is a physical directory on your current machine
and not a URL.

One helpful thing you can do is write a print/echo statement before
svnlook to STDERR. This will get printed only be displayed if your
hook fails, so you can even leave it there. Something like this
(assuming Bourne Shell or BASH):

    echo "DEBUG: SVNLOOK command '$svnlookCmd $arguments $repository'" 1>2&
    $svnlookCmd $arguments $repository

Then, you can copy and paste that command into a command windows and
see if you get similar results.

If you do, you can try tweaking it (probably the "$repository"
directory) until you get it to work.

I also write my hooks to take both the repository revision or a
transaction number (since this is a post-commit hook, you're only
doing a repository revision anyway). That way, I can try my hook
script out just in a command shell, outside of Subversion.

-- 
David Weintraub
qazwart_at_gmail.com
Received on 2010-09-29 15:19:38 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.