Sort hg files

This commit is contained in:
René Pfeuffer
2020-02-25 08:25:25 +01:00
parent 58625ba606
commit 76665b4dbe
2 changed files with 4 additions and 3 deletions

View File

@@ -153,7 +153,8 @@ class File_Walker:
return path
def walk(self, structure, parent = ""):
for key, value in structure.iteritems():
sortedItems = sorted(structure.iteritems(), key = lambda item: item[1])
for key, value in sortedItems:
if key == FILE_MARKER:
if value:
for v in value:

View File

@@ -190,7 +190,7 @@ public class HgBrowseCommandTest extends AbstractHgCommandTestBase {
Collection<FileObject> foList = root.getChildren();
assertThat(foList).extracting("name").containsExactlyInAnyOrder("a.txt", "b.txt");
assertThat(foList).extracting("name").containsExactlyInAnyOrder("c", "a.txt");
assertThat(root.isTruncated()).isTrue();
}
@@ -205,7 +205,7 @@ public class HgBrowseCommandTest extends AbstractHgCommandTestBase {
Collection<FileObject> foList = root.getChildren();
assertThat(foList).extracting("name").containsExactlyInAnyOrder("c", "f.txt");
assertThat(foList).extracting("name").containsExactlyInAnyOrder("b.txt", "f.txt");
assertThat(root.isTruncated()).isFalse();
}