Thread: RE: [Codestriker-user] Sorted list of files in a topic.
Brought to you by:
sits
From: Vysotsky, V. <vvy...@av...> - 2006-05-26 00:13:51
|
File list could get sorted: - through a link/CGI option in ViewTopic.pm (as suggested by David) - unconditionally on import (as suggested by Jason), or - conditionally on import, by providing a checkbox "Sort files by name" in CreateTopic/SubmitNewTopic. -- Vlad PS. I actually tried three ways to sort the list: 1) Sort the files in the UI - I couldn't find an easy way to do this. But for me, this would be a perfectly acceptable option. 2) Sort the files when retrieving them from the database (in Codestriker/Model/File.pm, get_filetable change the SQL statement to "... ORDER BY filename, sequence".) This didn't quite work, because the UI expects the file list to be sorted by sequence and fails to generate the page correctly otherwise. Is this a bug? 3) Sort the files when importing the diff, as described in my previous email. This worked for me. -----Original Message----- From: Jason Remillard [mailto:jre...@ya...]=20 Sent: Thursday, May 25, 2006 7:56 AM To: David Sitsky; Vysotsky, Vladimir Cc: cod...@li... Subject: Re: [Codestriker-user] Sorted list of files in a topic. Hi, How about it just sorts it all of the time given that the order that svn returns the files really does not have any meaning. Thanks Jason --- David Sitsky <si...@us...> wrote: > Hi Vlad, >=20 > > I'm creating topics directly from Subversion. One problem I've=20 > > noticed immediately is that file list in a topic is not sorted by=20 > > filename. Instead, files are listed in some semi-sorted order=20 > > defined by Subversion. I couldn't find any configuration options=20 > > that would trigger file sorting. Did I miss something? >=20 > The order the files are presented is the same as that in the text=20 > uploaded into Codestriker, or the order obtained from the SCM, in your > case, Subversion. So no, you didn't miss anything. >=20 > > Patching the code to sort by filename was rather trivial: in=20 > > lib\Codestriker\FileParser\Parser.pm, > > insert just before the first return: > >=20 > > # Sort the diff chunks by filename, then old linenumber > > @diffs =3D sort { $a->{filename} cmp $b->{filename} ||=20 > > $a->{old_linenumber} <=3D> $b->{old_linenumber} } @diffs; > > =20 > > Would it make sense to make this a configurable feature? >=20 > I can imagine this could be useful for large reviews. Rather than=20 > making this a configurable feature (codestriker.conf is also quite=20 > large and complex), it might be useful to have a link instead on the=20 > view topic page above the list of files, for example: >=20 > Download topic text | ... | Tab width ... | Sort by filename >=20 > Clicking on the sort by filename link will set a CGI parameter, which=20 > will then execute code similar to what you have, but this would be in=20 > ViewTopic.pm over the list of delta objects. That way, a reviewer can > choose at runtime which way they'd prefer to see the list of files=20 > presented. >=20 > What do you think? >=20 > Cheers, > David >=20 >=20 >=20 > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat=20 > certifications in the hosting industry. Fanatical Support. Click to=20 > learn more > = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat=3D= 1216 > 42 _______________________________________________ > Codestriker-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codestriker-user >=20 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com=20 |