mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-06 20:30:52 +01:00
Sort directories correctly
This commit is contained in:
@@ -153,7 +153,7 @@ class File_Walker:
|
||||
return path
|
||||
|
||||
def walk(self, structure, parent = ""):
|
||||
sortedItems = sorted(structure.iteritems(), key = lambda item: item[1])
|
||||
sortedItems = sorted(structure.iteritems(), key = lambda item: self.sortKey(item))
|
||||
for key, value in sortedItems:
|
||||
if key == FILE_MARKER:
|
||||
if value:
|
||||
@@ -166,6 +166,12 @@ class File_Walker:
|
||||
else:
|
||||
self.visit_directory(self.create_path(parent, value))
|
||||
|
||||
def sortKey(self, item):
|
||||
if (item[0] == FILE_MARKER):
|
||||
return "2"
|
||||
else:
|
||||
return "1" + item[0]
|
||||
|
||||
class SubRepository:
|
||||
url = None
|
||||
revision = None
|
||||
|
||||
Reference in New Issue
Block a user