diff mercurial/hgweb/hgwebdir_mod.py @ 6762:f67d1468ac50

util: add sort helper
author Matt Mackall <mpm@selenic.com>
date Fri, 27 Jun 2008 18:28:45 -0500
parents a63aed912e54
children 4879468fa28f
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Fri Jun 27 14:53:30 2008 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Fri Jun 27 18:28:45 2008 -0500
@@ -19,8 +19,8 @@
 class hgwebdir(object):
     def __init__(self, config, parentui=None):
         def cleannames(items):
-            return [(util.pconvert(name).strip('/'), path)
-                    for name, path in items]
+            return util.sort([(util.pconvert(name).strip('/'), path)
+                              for name, path in items])
 
         self.parentui = parentui or ui.ui(report_untrusted=False,
                                           interactive = False)
@@ -34,7 +34,6 @@
             self.repos_sorted = ('', False)
         elif isinstance(config, dict):
             self.repos = cleannames(config.items())
-            self.repos.sort()
         else:
             if isinstance(config, util.configparser):
                 cp = config