Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#1714 closed enhancement (fixed)

Pretty Sort for filenames with embedded numbers

Reported by: cmgreen@… Owned by: Jonas Borgström
Priority: normal Milestone: 0.9
Component: version control/browser Version: 0.8.4
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

In my source respository, I have the following pattern:

file1 … file9 file10 file11

This ends up as

file1 file10 file11 file2

Which isn't very fun for my users to deal with. I've taken a python recipe http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/214202 and sorted the filenames in order.

Attachments (1)

browser.py.diff (1.5 KB ) - added by cmgreen@… 19 years ago.

Download all attachments as: .zip

Change History (8)

by cmgreen@…, 19 years ago

Attachment: browser.py.diff added

comment:1 by Christopher Lenz, 19 years ago

Resolution: wontfix
Status: newclosed

I don't really see the point in this. Every file browser I'm aware of, and also the directory listings provided by mod_dav_svn, will list the directories using traditional alphanumeric sorting. If you want your directories to be sorted correctly, you should probably be padding with zeros, i.e. file01, file02, etc.

comment:2 by cmgreen@…, 19 years ago

I've seen some command shells in the past that were replacements for cmd.exe that perform sorts like this (I think it was 4DOS or 4NT).

I'd like to avoid renaming the files since they are word documents that cross reference each other by name (ie: Chapter1.doc Chapter2.doc etc.) so I'll just keep the patch local.

comment:3 by trac@…, 19 years ago

This kind of sort is built into Mac OS X, FWIW (i.e., try it in the Finder); see the list of string comparison flags available. It used to be provided by an extension called Natural Order originally written by Stuart Cheshire.

Not that I have a use for it in Trac because I don't name things like that, but it'd not be a bad thing to have.

comment:4 by cmgreen@…, 19 years ago

I've also found that this feature is built into windows explorer as well.

comment:5 by anonymous, 19 years ago

Resolution: wontfix
Status: closedreopened

it's called Natural Order sorting, & it's something that should at least be considered before brushing off as a wontfix…

comment:6 by Christopher Lenz, 19 years ago

Milestone: 0.9

Okay, you've convinced me. Pardon my ignorance :-)

comment:7 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: reopenedclosed

Implemented in [1980].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.