--- a/mercurial/hgweb.py Mon Aug 29 07:19:02 2005 +0200
+++ b/mercurial/hgweb.py Mon Aug 29 07:28:39 2005 +0200
@@ -922,8 +922,10 @@
# This is a stopgap
class hgwebdir:
def __init__(self, config):
- self.cp = ConfigParser.SafeConfigParser()
- self.cp.read(config)
+ cp = ConfigParser.SafeConfigParser()
+ cp.read(config)
+ self.repos = cp.items("paths")
+ self.repos.sort()
def run(self):
def header(**map):
@@ -939,9 +941,7 @@
def entries(**map):
parity = 0
- repos = self.cp.items("paths")
- repos.sort()
- for name, path in repos:
+ for name, path in self.repos:
u = ui()
u.readconfig(file(os.path.join(path, '.hg', 'hgrc')))
get = u.config
@@ -968,8 +968,8 @@
virtual = virtual.strip('/')
if len(virtual):
- if self.cp.has_option("paths", virtual):
- real = self.cp.get("paths", virtual)
+ real = dict(self.repos).get(virtual)
+ if real:
h = hgweb(real)
h.run()
return