hgweb: use a tuple-list instead of dictionary for append-only store
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 05 Nov 2009 15:01:00 +0100
changeset 9723 a235644a0b93
parent 9722 4d9dea174b84
child 9724 40ef3bf3e04a
hgweb: use a tuple-list instead of dictionary for append-only store
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	Thu Nov 05 15:19:54 2009 +0100
+++ b/mercurial/hgweb/hgwebdir_mod.py	Thu Nov 05 15:01:00 2009 +0100
@@ -20,7 +20,7 @@
     return [(util.pconvert(name).strip('/'), path) for name, path in items]
 
 def findrepos(paths):
-    repos = {}
+    repos = []
     for prefix, root in cleannames(paths):
         roothead, roottail = os.path.split(root)
         # "foo = /bar/*" makes every subrepo of /bar/ to be
@@ -30,7 +30,7 @@
         try:
             recurse = {'*': False, '**': True}[roottail]
         except KeyError:
-            repos[prefix] = root
+            repos.append((prefix, root))
             continue
         roothead = os.path.normpath(roothead)
         for path in util.walkrepos(roothead, followsym=True, recurse=recurse):
@@ -38,8 +38,8 @@
             name = util.pconvert(path[len(roothead):]).strip('/')
             if prefix:
                 name = prefix + '/' + name
-            repos[name] = path
-    return repos.items()
+            repos.append((name, path))
+    return repos
 
 class hgwebdir(object):
     refreshinterval = 20