mercurial/hgweb/hgwebdir_mod.py
branchstable
changeset 18515 bf8bbbf4aa45
parent 18258 bebb05a7e249
child 18645 76ff3a715cf2
equal deleted inserted replaced
18514:2a1fac3650a5 18515:bf8bbbf4aa45
   131         self.templatepath = self.ui.config('web', 'templates', None)
   131         self.templatepath = self.ui.config('web', 'templates', None)
   132         self.stripecount = self.ui.config('web', 'stripes', 1)
   132         self.stripecount = self.ui.config('web', 'stripes', 1)
   133         if self.stripecount:
   133         if self.stripecount:
   134             self.stripecount = int(self.stripecount)
   134             self.stripecount = int(self.stripecount)
   135         self._baseurl = self.ui.config('web', 'baseurl')
   135         self._baseurl = self.ui.config('web', 'baseurl')
       
   136         prefix = self.ui.config('web', 'prefix', '')
       
   137         if prefix.startswith('/'):
       
   138             prefix = prefix[1:]
       
   139         if prefix.endswith('/'):
       
   140             prefix = prefix[:-1]
       
   141         self.prefix = prefix
   136         self.lastrefresh = time.time()
   142         self.lastrefresh = time.time()
   137 
   143 
   138     def run(self):
   144     def run(self):
   139         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
   145         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
   140             raise RuntimeError("This function is only intended to be "
   146             raise RuntimeError("This function is only intended to be "
   393 
   399 
   394         self.refresh()
   400         self.refresh()
   395         self.updatereqenv(req.env)
   401         self.updatereqenv(req.env)
   396 
   402 
   397         return tmpl("index", entries=entries, subdir=subdir,
   403         return tmpl("index", entries=entries, subdir=subdir,
   398                     pathdef=makebreadcrumb('/' + subdir),
   404                     pathdef=makebreadcrumb('/' + subdir, self.prefix),
   399                     sortcolumn=sortcolumn, descending=descending,
   405                     sortcolumn=sortcolumn, descending=descending,
   400                     **dict(sort))
   406                     **dict(sort))
   401 
   407 
   402     def templater(self, req):
   408     def templater(self, req):
   403 
   409