Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgwebdir_mod.py @ 25426:5f3666da6910 stable
hgwebdir: don't allow the hidden parent of a subrepo to show as a directory
Previously, if a subrepo parent had 'web.hidden=True' set, neither the parent
nor child had a repository entry. However, the directory entry for the parent
would be listed (it wouldn't have the fancy 'web.name' if configured), and that
link went to the repo's summary page, effectively making it not hidden.
This simply disables the directory processing if a valid repository is present.
Whether or not the subrepo should be hidden is debatable, but this leaves that
behavior unchanged (i.e. it stays hidden).
author | Matt Harbison <mharbison@attotech.com> |
---|---|
date | Mon, 01 Jun 2015 18:06:20 -0400 |
parents | 78e8890cfb4b |
children | d0c7ffc4c8bc |
comparison
equal
deleted
inserted
replaced
25425:9263f86b9681 | 25426:5f3666da6910 |
---|---|
290 discarded = '/'.join(nameparts[1:]) | 290 discarded = '/'.join(nameparts[1:]) |
291 | 291 |
292 # remove name parts plus accompanying slash | 292 # remove name parts plus accompanying slash |
293 path = path[:-len(discarded) - 1] | 293 path = path[:-len(discarded) - 1] |
294 | 294 |
295 try: | |
296 r = hg.repository(self.ui, path) | |
297 directory = False | |
298 except (IOError, error.RepoError): | |
299 pass | |
300 | |
295 parts = [name] | 301 parts = [name] |
296 if 'PATH_INFO' in req.env: | 302 if 'PATH_INFO' in req.env: |
297 parts.insert(0, req.env['PATH_INFO'].rstrip('/')) | 303 parts.insert(0, req.env['PATH_INFO'].rstrip('/')) |
298 if req.env['SCRIPT_NAME']: | 304 if req.env['SCRIPT_NAME']: |
299 parts.insert(0, req.env['SCRIPT_NAME']) | 305 parts.insert(0, req.env['SCRIPT_NAME']) |