From 0d798632de0986cb056fec0fb58e2b2cd01422fd Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 12 Jul 2015 18:31:21 -0500 Subject: [PATCH] Allow viewing of hg repo if direct navigation --- indefero/scripts/hgweb.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indefero/scripts/hgweb.cgi b/indefero/scripts/hgweb.cgi index dec2b26..7430e97 100644 --- a/indefero/scripts/hgweb.cgi +++ b/indefero/scripts/hgweb.cgi @@ -6,6 +6,7 @@ # Path to repo or hgweb config to serve (see 'hg help hgweb') # config = "/path/to/repo/or/config" import os +import sys config = "/home/www/indefero/scripts/hgweb.config" # Uncomment and adjust if Mercurial is not installed system-wide @@ -20,7 +21,7 @@ from mercurial.hgweb import hgwebdir, wsgicgi application = hgwebdir(config) newrepos = [] for repo in application.repos: - if not os.path.isfile(repo[1] + "/.hide"): + if not os.path.isfile(repo[1] + "/.hide") or repo[0] in os.environ["REQUEST_URI"]: newrepos.append(repo) application.repos = newrepos wsgicgi.launch(application)