diff hgweb.cgi @ 5197:55860a45bbf2

Enable demandimport only in scripts, not in importable modules (issue605) This way other applications can choose if and when they want this feature, because it might be problematic if those applications rely on ImportError.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 18 Aug 2007 11:37:08 +0200
parents 6033d9f28052
children 79279b5583c6
line wrap: on
line diff
--- a/hgweb.cgi	Fri Aug 17 23:20:13 2007 -0300
+++ b/hgweb.cgi	Sat Aug 18 11:37:08 2007 +0200
@@ -2,6 +2,9 @@
 #
 # An example CGI script to use hgweb, edit as necessary
 
+# enable importing on demand to reduce startup time
+from mercurial import demandimport; demandimport.enable()
+
 # send python tracebacks to the browser if an error occurs:
 import cgitb
 cgitb.enable()