Add subversion rev number in committed file
From: CAVAILLES Philippe <Philippe.CAVAILLES_at_egis.fr>
Date: Tue, 5 Aug 2008 14:09:17 +0200
Hello,
I have tried to use a pre-commit hook script. I succeed to extract the
Here is the (pre-commit) script I have written:
--- #!/bin/sh REPOS="$1" TXN="$2" SVNLOOK=/usr/bin/svnlook commit_list=`$SVNLOOK changed -t $2 $1` prev_word="" new_commit_list="" for word in $commit_list do # only Added and Updated files are taken into account if [ "$prev_word" = "A" ] || [ "$prev_word" = "U" ] then # only .c and .h should be processed if [ ${word#*.} = "c" ] || [ ${word#*.} = "h" ] then new_commit_list="$new_commit_list $repos/$word" fi fi prev_word=$word done for word in $new_commit_list do cp $word /tmp /bin/sed "s/^-- VERSION:.*/-- VERSION: $vers/" /tmp/`basename $word` > $word done ------------------------------------------------------------------------ --- Kind regards,
---------------------------------------------------------------------
|
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.