[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: Martin Tomes <lists_at_tomes.org>
Date: 2004-06-09 10:27:48 CEST

Branko Čibej wrote:

> Martin Tomes wrote:
>
>
>>use strict;
> use warnings; would be a good idea here.

OK, done.

> * I suggest you move configurable paramters to the very top of the
> script, so that they're easier to find.

I have moved them to just after the copyright bit.

> * 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.

I have added 'use locale' to the script which according to the perldoc will ensure that perl uses
the current locale settings. I have removed the utf8 stuff from the open. The use locale is
accepted by ActiveState perl on Windows. Will this solve the problem? If the locale is set to use
utf8 will svnlook and this script play well together?

The book says that svnlook is meant to be used for commit hooks, doesn't your above comment mean
that svnlook has very limited value in this area?

If svnlook and perl cannot be made to work together I will work on a version of this script which
uses the bindings (which I have used for other scripts). Question, are the perl bindings installed
on windows by the svn windows installer?

> * Which version of Perl do you need for '-l:utf8'? Maybe you need a
> "require" line.

That I don't know, but I have removed the utf8 bit anyway for now. I have added a require 5.0004
which is the earliest version supporting use locale.

>
>> open(STDERR, ">c:/svnlog.txt");
>
> There is sucha thing as File::Temp in Perl...

I know, this is only for debugging and it is useful to know the name of the file the output will
appear in, if I used File::Temp I would have to write out the file name somewhere so I knew where to
look for the debug output. Of course I could remove the debug code for the published version if it
offends sensibilities:-)

Many thanks for the comments. If the above changes are acceptable I will re-post the script.

-- 
Martin Tomes
echo 'Martin x Tomes at controls x eurotherm x co x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 9 10:28:55 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.