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

Re: cannot get post-commit.tmpl to work

From: <Rebecca_Young_at_DSTInnovis.com>
Date: 2005-10-28 21:31:36 CEST

Zouari wrote:
it doesnt work, it seems as the system does not call that script
(search-replace.sh) , even if i insert an 'echo something' on top of
the script it doesnt echo anything.
am using this to do Revision number insertion in source code when
committing :
so here's my post-commit file :

#echo errr>>/tmp/log.test
/var/subversion/search-replace.sh .SVNREV. $REV "$REPOS/version"

here's my bash script search-replace.sh (it search for a string in a
file and replace it by a given value)


if [ $# -ne "$ARGS" ]
   echo "Usage: `basename $0` <search-word> <replace-word> <file>"
   exit $E_BADARGS

mv $3 $3.old.svn
sed "s/$1/$2/g" $3.old.svn > $3
rm -f $3.old.svn

it does not work even with this post-commit file :
mv "$REPOS/version" "$REPOS/version.old.svn"
sed "s/.SVNREV./$REV/g" "$REPOS/version.old.svn">"$REPOS/version"
rm -f "$REPOS/version.old.svn"
<<<<<<<<<<<<< end of Zouari wrote

Zouari, first, did you successfully get the post commit hook script to
Assuming so, perhaps you need to fully qualify all commands, since I
believe that no PATH is sent to script.
One more thing, you could send an output of your call to your script to a
log, catching stderr and stdout.
OK, third thing, will your search/replace work after the first
substitution? It seems like you're
doing a token search/replace on .SVNREV. but then it looks to me like the
next time it will not be there--
it will already be replaced by the actual SVN rev number? (perhaps not
all the script typed)

The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged. The information is
intended to be conveyed only to the designated recipient(s) of the message.
If the reader of this message is not the intended recipient, you are hereby
notified that any dissemination, use, distribution or copying of this
communication is strictly prohibited and may be unlawful. If you have
received this communication in error, please notify us immediately by
replying to the message and deleting it from your computer.
Received on Fri Oct 28 21:35:38 2005

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.