[PATCH] disable demandimport in debugger mode

Gilles Moris gilles.moris at free.fr
Sat Feb 7 12:48:46 CST 2009


1 file changed, 6 insertions(+), 3 deletions(-)
hg |    9 ++++++---


# HG changeset patch
# User Gilles Moris <gilles.moris at free.fr>
# Date 1234032057 -3600
# Node ID 9584272ac2049037e37128a950c8c7b94fcc5d41
# Parent  a1138f437640dcfa6579473c36aff6da691b467d
disable on demand module loading when debugger mode is activated

On demand loading is mostly for performance optimisation, so does not make
sense for debug but clutters the debugging sessions with module loading.

diff -r a1138f437640 -r 9584272ac204 hg
--- a/hg	Thu Jan 29 19:25:25 2009 +0100
+++ b/hg	Sat Feb 07 19:40:57 2009 +0100
@@ -8,16 +8,19 @@
 # of the GNU General Public License, incorporated herein by reference.
 
 # enable importing on demand to reduce startup time
+import sys
 try:
-    from mercurial import demandimport; demandimport.enable()
+    from mercurial import demandimport
+    if '--debugger' not in sys.argv:
+        demandimport.enable()
+    else:
+        demandimport.disable()
 except ImportError:
-    import sys
     sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                      ' '.join(sys.path))
     sys.stderr.write("(check your install and PYTHONPATH)\n")
     sys.exit(-1)
 
-import sys
 import mercurial.util
 import mercurial.dispatch
 


More information about the Mercurial-devel mailing list