[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: Johan Corveleyn <johan.corveleyn_at_uz.kuleuven.ac.be>
Date: Fri, 25 Sep 2009 13:01:14 +0200

> Van: Marc Lustig [mailto:ml_at_marclustig.com]
>
> TAGS_REGEX='tags/[^/]\+'
> # 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 | \
> uniq`
>
>
> 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

It's the grep part of the command: "grep ^tags/" will not match "project/tags/...". It only matches if "tags" is at the very beginning of the line (because "^" matches beginning of line).

So I guess that snippet only works for repositories that have "tags" at the root of the repository, and not below individual project folders...

Johan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2400186

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-09-25 13:02:07 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.