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

Re: implementing pre-commit-hook to prevent overwriting files under tags-dir

From: Marc Lustig <ml_at_marclustig.com>
Date: Fri, 25 Sep 2009 02:26:25 -0700 (PDT)

After getting the pre-commit script to run, I noticed that the logic is not
working as expected.

When I try committing a change of a file that resides under tags, the script
should identify that, output an error-message and exit with code 1. But this
doesn't work.

Here is the relevant snippet:

# Get list of transactions in the 'tag' directory
TAGS_CHANGES=`"$SVNLOOK" changed -t "$TXN" "$REPOS" 2>/dev/null | \
                 awk '{ print $2; }' 2>/dev/null | \
                 grep ^tags/ 2>/dev/null | \
                 sed -e "s!^\($TAGS_REGEX\).*!\1!" | \
                 sort | \

I figured out, when I commit a file, the variable TAGS_CHANGES is empty.

The command
$SVNLOOK" changed -t "$TXN" "$REPOS"
prints out the list of committed files properly. LIke
U project/tags/1.1.1/file.xml

The bug must be somewhere else.

View this message in context: http://www.nabble.com/implementing-pre-commit-hook-to-prevent-overwriting-files-under-tags-dir-tp25570855p25609076.html
Sent from the Subversion Users mailing list archive at Nabble.com.
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-09-25 11:27:20 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.