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

Re: Slow performance in check-case-insensitive.pl?

From: Martin Tomes <lists_at_tomes.org>
Date: 2005-07-26 14:46:03 CEST

Marc Sherman wrote:
> Thanks for getting back to me, Martin. Do you read users@subversion, or
> would you like me to keep CC'ing you?

> Ok, do you possibly have a few minutes to describe the changes you were
> planning to make in a bit more detail, so that I can take a crack at
> them myself? My python's quite rusty, but I'll try to get over my
> irrational distaste for significant whitespace. :)

Python isn't as bad as I thought it would be, I even got to quite like
it despite knowing Perl pretty well:-) Actually I find the Python
humour a wearing and that's my biggest criticism of it.

Currently the script looks for all added files, then it finds the
highest common point in the file tree. It the gets a list of files in
the transaction from that point downwards and checks every directory for
a clash.

This is a bit silly, but being new to Python and more importantly the
bindings I took the conservative route and use the algorithm I intended
to use in the Perl version.

What the script should do is:

for each of the added files:
   work out the directory it is in
   add it to a list removing duplicates

for each of the directories
   get a listing of that directory and *not* it's children
   check that listing for name clashes

Example 8.2 from the book has a useful snippet of code for doing this:

http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-8-sect-2.3-ex-1

I think the script will be smaller, simpler and most importantly a lot
faster if you do this.

>> The old script can miss filename clashes, so the new one is an
>> improvement, honest:-)
>
> What's the failure mode, adding two files with clashing names in a
> single revision? Or is there a more subtle failure mode I've missed?

It is the way it calculates the root of the changed part of the tree, it
can get that wrong so if there are separate clashes in different parts
of the tree the perl version can miss one of them.

Thanks for the offer of help - it is much appreciated.

-- 
Martin Tomes
echo 'martin at tomes x org x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'
Visit http://www.subversionary.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jul 26 14:48:07 2005

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