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

Re: post-commit REPOS var empty

From: Patrick Smears <patrick.smears_at_ensoft.co.uk>
Date: 2004-11-16 17:12:33 CET

On Tue, 16 Nov 2004, Toni Price wrote:

> I have just attempted to compile and install Subversion 1.1.1 on SUSE
> Linux 9.1 and it seems to be working but I'm having a problem with a
> post-commit hook. I've got the following post-commit script called
> 'post-commit':
>
> REPOS="$1"
> REV="$2"
> echo ${REPOS} >> env_vars.txt
> echo ${REV} >> env_vars.txt
> (cd /home/srv/svn/hook_scripts; ./hot-backup.py ${REPOS} \
> /bak/svn/hotbak &)
>
> I've put it in the relevant 'hooks' directory and made sure it has
> execute permissions. There's a copy of hot-backup.py in the location
> referred to (i.e. /home/srv/svn/hook_scripts/hot-backup.py exists) and
> the scripts are owned by the same user as the Apache webserver (wwwrun).
>
> If I try to run the script with the following command:
> $ sudo -u wwwrun ./post-commit
>
> It starts running and prints the following to the console:
> Usage: hot-backup.py <repos_path> <backup_path>
>
> Then it hangs and I need to Ctrl-c.
>
> So I put in the "echo ..." lines to try and test what the values of
> $REPOS and $REV are when the script gets called. Curiously, they seem to
> be empty, which would explain why hot-backup.py is failing like that.
>
> I couldn't seem to find any information (on the mailing lists or from
> searching the Internet) showing other people might have had the same
> sort of problem - so I have no idea what I may be doing wrong.
>
> Any pointers would be appreciated ...

If I read your mail correctly, you're running the post-commit script *by
hand*, not from a commit - is that right? (If not, I've misunderstood, so
ignore me!)

The first two lines of the script:

> REPOS="$1"
> REV="$2"

... set the variables REPOS and REV to values passed on the command line.
So I would expect the following:

> $ sudo -u wwwrun ./post-commit reposname revnum

to set the variables "REPOS" and "REV" to "reposname" and "revnum"
respectively...

Patrick

-- 
The easy way to type accents in Windows: http://www.frkeys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Nov 16 17:13:15 2004

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.