Add option "hidden" to hgwebdir.
TODO: should this option be renamed to 'hide_from_index' or
maybe to 'index_ignore' (like Apache's mod_autoindex) ?
--- a/doc/hgrc.5.txt
+++ b/doc/hgrc.5.txt
@@ -525,6 +525,8 @@ web::
Default is "unknown".
errorlog;;
Where to output the error log. Default is stderr.
+ hidden;;
+ Whether to hide the repository in the hgwebdir index. Default is false.
ipv6;;
Whether to use IPv6. Default is false.
name;;
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -142,6 +142,9 @@ class hgwebdir(object):
def get(section, name, default=None):
return u.config(section, name, default, untrusted=True)
+ if u.configbool("web", "hidden", untrusted=True):
+ continue
+
url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
.replace("//", "/")) + '/'