# HG changeset patch # User Marcin Lulek # Date 2019-02-12 09:24:48 # Node ID 5fd6f6788da8c0e5b9fdfb1c14c7bb69ed654394 # Parent 41f317da9ec1d83d78e8fea625871927c8b75471 nodes: make submodules sorting be equal to Directory diff --git a/rhodecode/lib/vcs/nodes.py b/rhodecode/lib/vcs/nodes.py --- a/rhodecode/lib/vcs/nodes.py +++ b/rhodecode/lib/vcs/nodes.py @@ -200,8 +200,12 @@ class Node(object): """ Comparator using name of the node, needed for quick list sorting. """ + kind_cmp = cmp(self.kind, other.kind) if kind_cmp: + if isinstance(self, SubModuleNode): + # we make submodules equal to dirnode for "sorting" purposes + return NodeKind.DIR return kind_cmp return cmp(self.name, other.name)