mercurial/hgweb/hgwebdir_mod.py
changeset 2506 d0db3462d568
parent 2391 d351a3be3371
child 2509 6350b01d173f
equal deleted inserted replaced
2505:01b856927970 2506:d0db3462d568
     9 import os
     9 import os
    10 from mercurial.demandload import demandload
    10 from mercurial.demandload import demandload
    11 demandload(globals(), "ConfigParser")
    11 demandload(globals(), "ConfigParser")
    12 demandload(globals(), "mercurial:ui,hg,util,templater")
    12 demandload(globals(), "mercurial:ui,hg,util,templater")
    13 demandload(globals(), "mercurial.hgweb.hgweb_mod:hgweb")
    13 demandload(globals(), "mercurial.hgweb.hgweb_mod:hgweb")
    14 demandload(globals(), "mercurial.hgweb.request:hgrequest")
       
    15 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile")
    14 demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile")
    16 from mercurial.i18n import gettext as _
    15 from mercurial.i18n import gettext as _
    17 
    16 
    18 # This is a stopgap
    17 # This is a stopgap
    19 class hgwebdir(object):
    18 class hgwebdir(object):
    45                         if name.startswith(prefix):
    44                         if name.startswith(prefix):
    46                             name = name[len(prefix):]
    45                             name = name[len(prefix):]
    47                         self.repos.append((name.lstrip(os.sep), repo))
    46                         self.repos.append((name.lstrip(os.sep), repo))
    48             self.repos.sort()
    47             self.repos.sort()
    49 
    48 
    50     def run(self, req=hgrequest()):
    49     def run(self, req):
    51         def header(**map):
    50         def header(**map):
    52             yield tmpl("header", **map)
    51             yield tmpl("header", **map)
    53 
    52 
    54         def footer(**map):
    53         def footer(**map):
    55             yield tmpl("footer", motd=self.motd, **map)
    54             yield tmpl("footer", motd=self.motd, **map)