* viewcvs/lib/viewcvs.py
(file_sort_cmp): Only treat directories as special when sorting by name. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1010 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/tags/1.0.0-rc1
parent
f85b7bb67e
commit
b5cf642f0e
|
@ -1379,15 +1379,16 @@ def prepare_hidden_values(params):
|
|||
|
||||
def sort_file_data(file_data, sortdir, sortby):
|
||||
def file_sort_cmp(file1, file2, sortby=sortby):
|
||||
if file1.kind == vclib.DIR: # is_directory
|
||||
if sortby == 'file':
|
||||
if file1.kind == vclib.DIR: # is_directory
|
||||
if file2.kind == vclib.DIR:
|
||||
# both are directories. sort on name.
|
||||
return cmp(file1.name, file2.name)
|
||||
# file1 is a directory, it sorts first.
|
||||
return -1
|
||||
if file2.kind == vclib.DIR:
|
||||
# both are directories. sort on name.
|
||||
return cmp(file1.name, file2.name)
|
||||
# file1 is a directory, it sorts first.
|
||||
return -1
|
||||
if file2.kind == vclib.DIR:
|
||||
# file2 is a directory, it sorts first.
|
||||
return 1
|
||||
# file2 is a directory, it sorts first.
|
||||
return 1
|
||||
|
||||
# we should have data on these. if not, then it is because we requested
|
||||
# a specific tag and that tag is not present on the file.
|
||||
|
|
Loading…
Reference in New Issue