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

Re: svn list - sorting (natural sort)

From: Rob Shepherd <robshep_at_informatics.bangor.ac.uk>
Date: 2005-02-06 19:10:01 CET

Ryan Schmidt wrote:
> On 06.02.2005, at 00:46, allan juul wrote:
>
>> is there a way to tweak the sort order of a "svn list URL" ?
>>
>> our tagging are basically numbers:
>>
>> module/v_1
>> module/v_3
>> module/v_20
>> module/v_112
>>
>> the above list will be sorted like this :
>>
>> module/v_1
>> module/v_112
>> module/v_20
>> module/v_3
>>
>> it's not the greatest issue, but would sometimes be nice to be able to
>> supply a "sort-by" option on the command line.
>
>
> I think the "Unix way" would be to pipe the output of "svn list URL" to
> a separate sorting program.
>
> The man page for "sort" didn't hint at a way to get it to do
> natural-order sorting, so here's a PHP script you can pipe your output
> through:

unix sort will sort this as you wish by default

svn list URL | sort

you may find sort from the cygwin environment will work on windows.

Rob

-- 
/**
  *	Rob Shepherd,
  *	University Of Wales, Bangor,
  *	School of Informatics,
  *	Dean Street,
  *	Bangor,
  *	Gwynedd, UK     /\  /\
  *	LL57 1UT       /  \/  \ /\
  *	--------------/---/    \--\----
  *	
  *	robshep@informatics.bangor.ac.uk
  *
  *	+44 (0) 1248 38 27
  */

Received on Sun Feb 6 19:12:24 2005

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

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