Mercurial > hg
comparison mercurial/hgweb/hgwebdir_mod.py @ 6908:b77c25c2d6c0
Do not sort hgwebdir repositories if python list or tuple is given.
This was introduced by changeset f67d1468ac50 (util: add sort helper)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 19 Aug 2008 18:17:11 +0200 |
parents | 8909070fd05e |
children | 580d5e6bfc1f |
comparison
equal
deleted
inserted
replaced
6907:6dcbe191a9b5 | 6908:b77c25c2d6c0 |
---|---|
17 | 17 |
18 # This is a stopgap | 18 # This is a stopgap |
19 class hgwebdir(object): | 19 class hgwebdir(object): |
20 def __init__(self, config, parentui=None): | 20 def __init__(self, config, parentui=None): |
21 def cleannames(items): | 21 def cleannames(items): |
22 return util.sort([(util.pconvert(name).strip('/'), path) | 22 return [(util.pconvert(name).strip('/'), path) |
23 for name, path in items]) | 23 for name, path in items] |
24 | 24 |
25 self.parentui = parentui or ui.ui(report_untrusted=False, | 25 self.parentui = parentui or ui.ui(report_untrusted=False, |
26 interactive = False) | 26 interactive = False) |
27 self.motd = None | 27 self.motd = None |
28 self.style = None | 28 self.style = None |
31 self._baseurl = None | 31 self._baseurl = None |
32 if isinstance(config, (list, tuple)): | 32 if isinstance(config, (list, tuple)): |
33 self.repos = cleannames(config) | 33 self.repos = cleannames(config) |
34 self.repos_sorted = ('', False) | 34 self.repos_sorted = ('', False) |
35 elif isinstance(config, dict): | 35 elif isinstance(config, dict): |
36 self.repos = cleannames(config.items()) | 36 self.repos = util.sort(cleannames(config.items())) |
37 else: | 37 else: |
38 if isinstance(config, util.configparser): | 38 if isinstance(config, util.configparser): |
39 cp = config | 39 cp = config |
40 else: | 40 else: |
41 cp = util.configparser() | 41 cp = util.configparser() |