changeset 4709:53eca35c3aeb

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) ?
author Markus F.X.J. Oberhumer <markus@oberhumer.com>
date Mon, 25 Jun 2007 14:46:20 +0200
parents 01f9ee4de1ad
children 1aba0b752847
files doc/hgrc.5.txt mercurial/hgweb/hgwebdir_mod.py
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/hgrc.5.txt	Mon Jun 25 14:46:20 2007 +0200
+++ b/doc/hgrc.5.txt	Mon Jun 25 14:46:20 2007 +0200
@@ -525,6 +525,8 @@
     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	Mon Jun 25 14:46:20 2007 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Mon Jun 25 14:46:20 2007 +0200
@@ -142,6 +142,9 @@
                 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("//", "/")) + '/'