Rev 2539: Found an import dependency bug if the compiled version is not available. in http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/dirstate_pyrex

John Arbash Meinel john at arbash-meinel.com
Thu Jul 12 06:26:16 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/dirstate_pyrex

------------------------------------------------------------
revno: 2539
revision-id: john at arbash-meinel.com-20070712052601-n0bcu3r5nlu1skj4
parent: john at arbash-meinel.com-20070712051503-ntboo0z3prcrcg3t
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate_pyrex
timestamp: Thu 2007-07-12 00:26:01 -0500
message:
  Found an import dependency bug if the compiled version is not available.
  Basically, we need a constant from dirstate.py, but we can't import the module directly
  because before the module finishes loading, it imports _dirstate_helper*.
  but bzrlib.dirstate.DirState *has* been defined at that point,
  so we can import it.
  But now the tests pass with and without running 'make' first.
modified:
  bzrlib/_dirstate_helpers_py.py _dirstate_helpers_py-20070710145033-90nz6cqglsk150jy-1
-------------- next part --------------
=== modified file 'bzrlib/_dirstate_helpers_py.py'
--- a/bzrlib/_dirstate_helpers_py.py	2007-07-12 05:14:26 +0000
+++ b/bzrlib/_dirstate_helpers_py.py	2007-07-12 05:26:01 +0000
@@ -18,9 +18,9 @@
 
 import os
 
-from bzrlib import (
-    dirstate,
-    )
+# We cannot import the dirstate module, because it loads this module
+# All we really need is the IN_MEMORY_MODIFIED constant
+from bzrlib.dirstate import DirState
 
 
 def bisect_path_left_py(paths, path):
@@ -231,7 +231,7 @@
     #                          key=lambda blk:blk[0].split('/'))
     # To convert from format 3 => format 2
     # state._dirblocks = sorted(state._dirblocks)
-    state._dirblock_state = dirstate.DirState.IN_MEMORY_UNMODIFIED
+    state._dirblock_state = DirState.IN_MEMORY_UNMODIFIED
 
 
 def cmp_by_dirs_py(path1, path2):



More information about the bazaar-commits mailing list