mercurial/hgweb/hgwebdir_mod.py
changeset 9724 40ef3bf3e04a
parent 9723 a235644a0b93
child 9842 d3dbdca92458
equal deleted inserted replaced
9723:a235644a0b93 9724:40ef3bf3e04a
    87                 name = util.pconvert(repo)
    87                 name = util.pconvert(repo)
    88                 if name.startswith(prefix):
    88                 if name.startswith(prefix):
    89                     name = name[len(prefix):]
    89                     name = name[len(prefix):]
    90                 self.repos.append((name.lstrip('/'), repo))
    90                 self.repos.append((name.lstrip('/'), repo))
    91 
    91 
    92         self.repos.sort()
       
    93         self.lastrefresh = time.time()
    92         self.lastrefresh = time.time()
    94 
    93 
    95     def run(self):
    94     def run(self):
    96         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
    95         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
    97             raise RuntimeError("This function is only intended to be "
    96             raise RuntimeError("This function is only intended to be "
   194                 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
   193                 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
   195                                                     untrusted=True):
   194                                                     untrusted=True):
   196                     yield {"type" : i[0], "extension": i[1],
   195                     yield {"type" : i[0], "extension": i[1],
   197                            "node": nodeid, "url": url}
   196                            "node": nodeid, "url": url}
   198 
   197 
   199         sortdefault = 'name', False
   198         sortdefault = None, False
   200         def entries(sortcolumn="", descending=False, subdir="", **map):
   199         def entries(sortcolumn="", descending=False, subdir="", **map):
   201 
   200 
   202             rows = []
   201             rows = []
   203             parity = paritygen(self.stripecount)
   202             parity = paritygen(self.stripecount)
   204             descend = self.ui.configbool('web', 'descend', True)
   203             descend = self.ui.configbool('web', 'descend', True)