##// END OF EJS Templates
Enable demandimport only in scripts, not in importable modules (issue605)...
Thomas Arendsen Hein -
r5197:55860a45 default
parent child Browse files
Show More
@@ -25,6 +25,9 b' You can use pattern matching of your nor'
25 command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"
25 command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"
26 """
26 """
27
27
28 # enable importing on demand to reduce startup time
29 from mercurial import demandimport; demandimport.enable()
30
28 from mercurial import dispatch
31 from mercurial import dispatch
29
32
30 import sys, os
33 import sys, os
@@ -2,6 +2,9 b''
2 #
2 #
3 # An example CGI script to export multiple hgweb repos, edit as necessary
3 # An example CGI script to export multiple hgweb repos, edit as necessary
4
4
5 # enable demandloading to reduce startup time
6 from mercurial import demandimport; demandimport.enable()
7
5 # send python tracebacks to the browser if an error occurs:
8 # send python tracebacks to the browser if an error occurs:
6 import cgitb
9 import cgitb
7 cgitb.enable()
10 cgitb.enable()
@@ -7,5 +7,8 b''
7 # This software may be used and distributed according to the terms
7 # This software may be used and distributed according to the terms
8 # of the GNU General Public License, incorporated herein by reference.
8 # of the GNU General Public License, incorporated herein by reference.
9
9
10 # enable importing on demand to reduce startup time
11 from mercurial import demandimport; demandimport.enable()
12
10 import mercurial.dispatch
13 import mercurial.dispatch
11 mercurial.dispatch.run()
14 mercurial.dispatch.run()
@@ -2,6 +2,9 b''
2 #
2 #
3 # An example CGI script to use hgweb, edit as necessary
3 # An example CGI script to use hgweb, edit as necessary
4
4
5 # enable importing on demand to reduce startup time
6 from mercurial import demandimport; demandimport.enable()
7
5 # send python tracebacks to the browser if an error occurs:
8 # send python tracebacks to the browser if an error occurs:
6 import cgitb
9 import cgitb
7 cgitb.enable()
10 cgitb.enable()
@@ -2,6 +2,9 b''
2 #
2 #
3 # An example CGI script to export multiple hgweb repos, edit as necessary
3 # An example CGI script to export multiple hgweb repos, edit as necessary
4
4
5 # enable importing on demand to reduce startup time
6 from mercurial import demandimport; demandimport.enable()
7
5 # send python tracebacks to the browser if an error occurs:
8 # send python tracebacks to the browser if an error occurs:
6 import cgitb
9 import cgitb
7 cgitb.enable()
10 cgitb.enable()
@@ -6,7 +6,6 b''
6 # This software may be used and distributed according to the terms
6 # This software may be used and distributed according to the terms
7 # of the GNU General Public License, incorporated herein by reference.
7 # of the GNU General Public License, incorporated herein by reference.
8
8
9 from mercurial import demandimport; demandimport.enable()
10 import os, mimetools, cStringIO
9 import os, mimetools, cStringIO
11 from mercurial.i18n import gettext as _
10 from mercurial.i18n import gettext as _
12 from mercurial import ui, hg, util, templater
11 from mercurial import ui, hg, util, templater
@@ -14,8 +14,6 b' from distutils.core import setup, Extens'
14 from distutils.command.install_data import install_data
14 from distutils.command.install_data import install_data
15
15
16 import mercurial.version
16 import mercurial.version
17 import mercurial.demandimport
18 mercurial.demandimport.enable = lambda: None
19
17
20 extra = {}
18 extra = {}
21
19
General Comments 0
You need to be logged in to leave comments. Login now