[PATCH 09 of 11] [RFC] Add option "hidden" to hgwebdir
Markus F.X.J. Oberhumer
markus at oberhumer.com
Mon Jun 25 12:50:46 UTC 2007
# HG changeset patch
# User Markus F.X.J. Oberhumer <markus at oberhumer.com>
# Date 1182775580 -7200
# Node ID 52eb68317e0f5dae21b476656af18a26b65ed682
# Parent 9dec45eed1ed8c6b818563aaa2bb233a611f5768
[RFC] 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) ?
diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt
--- 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;;
diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -141,6 +141,9 @@ class hgwebdir(object):
pass
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("//", "/")) + '/'
More information about the Mercurial-devel
mailing list