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

RE: Re: Repobrowser - Numeric order filename sorting

From: Gerasimov, Ivan <Ivan.Gerasimov_at_transas.com>
Date: 2006-04-11 13:57:31 CEST

Hello, Russell!

> >
> > 2004.06.12
> > 2005.06.12
> > 2005.07.12
> > 2005.07.13
> >
> > What's wrong with dates?
> >
>
> I think it should also handle - and _ (and for other locale's, comam's
> too) and whatever else people use as separators as sometimes these are
> used in filenames for separating versions/dates. Perhaps all symbols
> should be treated as possible numeric separators.
>

Please, take a look at the routine itself. It doesn't _handle_ any separators at all. It only finds the position in compared strings, where they are different. If it turns out that there are numbers at that position in both strings, it compares the numbers. Otherwise, the routine compares the literals.

> FWIW, we then to use Year-Month-Day in filenames even though our locale
> is UK (day/month/year) because it makes sorting filenames that have
> dates in easier.
>

Well, so do I. I don't think anyone would expect that a program is smart enough to recognize date or time or whatever in a filename.

The only sorting orders a user might expect are alpha or numeric.
The function I have provided tries to do the best possible guess - sort numerically, if possible, and literally otherwise.

Sincerely yours,
Ivan Gerasimov

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Apr 11 13:58:03 2006

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

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