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

Re: pre-commit hook that stops CaSe-InSenSiTive collisions

From: Branko Čibej <brane_at_xbc.nu>
Date: 2004-06-09 03:34:22 CEST

Martin Tomes wrote:

>use strict;
>
>
use warnings; would be a good idea here.

>my $opSys = $^O;
>
>my $svnlook;
>my $openstr;
>
># Please check the path to svnlook is correct...
>if ($opSys eq 'MSWin32') {
> $svnlook = '"c:\Program Files\subversion\bin\svnlook.exe"';
> $openstr = '-|';
>} else {
> $svnlook = '/usr/local/bin/svnlook';
> $openstr = '-|:utf8';
>}
>
>
    * I suggest you move configurable paramters to the very top of the
      script, so that they're easier to find.
    * Why doesn't the Win32 variant open the svnlook pipe in utf8 mode?
      I wonder if svnlook does, in fact, print utf8 paths. Hmmm... no it
      does not. Svnlook will only write utf-8 filenames if your current
      locale is utf-8. So much for this script then -- it won't work.
      You should use the bindings instead.
    * Which version of Perl do you need for '-l:utf8'? Maybe you need a
      "require" line.

># If there is too much debug output to STDERR subversion doesn't like it, so,
># if a lot of output is expected send it to a file instead.
>if ($debug > 1) {
> if ($opSys eq 'MSWin32') {
> open(STDERR, ">c:/svnlog.txt");
> } else {
> open(STDERR, ">/tmp/svnlog.txt");
> }
>}
>
>
There is sucha thing as File::Temp in Perl...

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 9 03:35:24 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.