Fra: Miha Vitorovic [mvitorovic@nil.si] Sendt: 12. oktober 2005 12:24 Til: René Vestergaard Cc: stevewilliams@kromestudios.com; Greg Thomas; users@subversion.tigris.org Emne: Re: SV: SV: Request Tag-PreCommit-Script/hook for use at the OS: Windows Server 2003 René Vestergaard wrote on 12.10.2005 12:12:14: > Now the "/tags/"-repository-paths can't be commit'ed (fine), > but they can not be created either (bad) > (created = create a branch/tag to "/tags/v1.0"). > > Is there any way to allow Branch/Tag-command to execute, but permit > commit's? > Actually, what you need to do is, is check if the svnlook result contains "/tags/" (as you do), and if the flags are U (update) or D (delete) . If you want to translate it into windows CMD, you are going to need some string parsing tools (preferably ones that support regular expressions) Here is a little perl script that I use (on Windows): [--- cut 'ere ---] #!c:/perl/bin/Perl.exe use strict; my $svnlook = "C:/Progra~1/Subver~1/bin/svnlook.exe"; my $repo_path = $ARGV[ 0 ]; my $txn_name = $ARGV[ 1 ]; open( INPUT, "$svnlook changed -t $txn_name $repo_path|" ); while( ){ if( /^[UD]\s*?.*?\/?tags\/.*/i ) { printf STDERR "Cannot modify a tag.\n"; close INPUT; exit 1; } } close INPUT; exit 0; [--- cut 'ere ---] --- Miha Vitorovic Inženir v tehničnem področju Customer Support Engineer NIL Data Communications, Tivolska cesta 48, 1000 Ljubljana, Slovenia Phone +386 1 4746 500 Fax +386 1 4746 501 http://www.NIL.si --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org For additional commands, e-mail: users-help@subversion.tigris.org