Patch: When demandimport is disabled the 'test-profile' test fails.

Alejandro Santos alejolp at alejolp.com
Tue Jul 28 11:05:05 CDT 2009


On crew repo, 'test-profile' test fails when demandimport is disabled
(by removing the call on the hg executable).

At the end of this message there is a possible fix for it.

$ diff -u test-profile.out test-profile.err
--- test-profile.out    2009-06-16 00:23:56.000000000 -0300
+++ test-profile.err    2009-07-28 13:00:27.000000000 -0300
@@ -1,2 +1,29 @@
 % test --time
 % test --profile
+--profile failed
+** unknown exception encountered, details follow
+** report bug details to http://mercurial.selenic.com/bts/
+** or mercurial at selenic.com
+** Mercurial Distributed SCM (version 0d04d42fbab4)
+** Extensions loaded:
+Traceback (most recent call last):
+  File "/tmp/hgtests.xStzl7/install/bin/hg", line 30, in <module>
+    mercurial.dispatch.run()
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/dispatch.py",
line 16, in run
+    sys.exit(dispatch(sys.argv[1:]))
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/dispatch.py",
line 27, in dispatch
+    return _runcatch(u, args)
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/dispatch.py",
line 43, in _runcatch
+    return _dispatch(ui, args)
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/dispatch.py",
line 449, in _dispatch
+    return runcommand(lui, repo, cmd, fullargs, ui, options, d)
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/dispatch.py",
line 317, in runcommand
+    ret = _runcommand(ui, options, cmd, d)
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/dispatch.py",
line 496, in _runcommand
+    stats.pprint(top=10, file=ostream, climit=5)
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/lsprof.py",
line 48, in pprint
+    e.inlinetime, label(e.code)))
+  File "/tmp/hgtests.xStzl7/install/lib/python/mercurial/lsprof.py",
line 88, in label
+    for k, v in sys.modules.iteritems():
+RuntimeError: dictionary changed size during iteration
+--profile + output to file failed


-- 
Alejandro Santos,
alejolp at alejolp.com



# HG changeset patch
# User Alejandro Santos <alejolp at alejolp.com>
# Date 1248796898 10800
# Node ID c8d7c56e4c1a27adccb78156c1ed8fb4b04ff865
# Parent  0d04d42fbab4d6d051fd5bea8f75e021b31d9e2a
When demandimport is disabled the 'test-profile' test fails.

diff -r 0d04d42fbab4 -r c8d7c56e4c1a mercurial/lsprof.py
--- a/mercurial/lsprof.py       Tue Jul 28 12:54:33 2009 -0300
+++ b/mercurial/lsprof.py       Tue Jul 28 13:01:38 2009 -0300
@@ -85,7 +85,7 @@
     try:
         mname = _fn2mod[code.co_filename]
     except KeyError:
-        for k, v in sys.modules.iteritems():
+        for k, v in list(sys.modules.iteritems()):
             if v is None:
                 continue
             if not hasattr(v, '__file__'):


More information about the Mercurial-devel mailing list