Rev 28: Explicitly force demandimport to be disabled. in http://bazaar.launchpad.net/%7Ejameinel/bzr-hg/demandload_import_fixes

John Arbash Meinel john at arbash-meinel.com
Tue Jul 31 20:40:27 BST 2007


At http://bazaar.launchpad.net/%7Ejameinel/bzr-hg/demandload_import_fixes

------------------------------------------------------------
revno: 28
revision-id: john at arbash-meinel.com-20070731194027-f94qqahm1tuel3mp
parent: john at arbash-meinel.com-20070731183147-cybug7bbq0ia4a2u
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: hg
timestamp: Tue 2007-07-31 14:40:27 -0500
message:
  Explicitly force demandimport to be disabled.
modified:
  __init__.py                    __init__.py-20060531211707-2fy7rwqqcmfgf8ve-1
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2007-07-31 18:31:47 +0000
+++ b/__init__.py	2007-07-31 19:40:27 +0000
@@ -27,6 +27,20 @@
  * we convert manifests to inventories on the fly.
 """
 
+# First thing we need to do is keep mercurial from messing up everyone else by
+# enabling a slightly-broken demand importing scheme.
+try:
+    from mercurial import demandimport
+except ImportError:
+    pass
+else:
+    enable = getattr(demandimport, 'enable', None)
+    if enable is not None:
+        # Make sure we aren't currently using the lazy importing
+        demandimport.disable()
+        # and make sure we can't re-enable it
+        demandimport.enable = lambda : None
+
 import copy
 import os
 import stat



More information about the bazaar-commits mailing list