Register optimizers lazily.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 17 Sep 2007 00:48:18 +0000 (02:48 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 17 Sep 2007 00:48:18 +0000 (02:48 +0200)
__init__.py
repository.py

index cbcefe6e74e7325128fdc9e141e9aa32c2a6b91c..a5d4eda242a25648a2c4f4a41789dd28a8ad0ca6 100644 (file)
@@ -131,8 +131,14 @@ def lazy_check_versions():
     check_bzrlib_version(COMPATIBLE_BZR_VERSIONS)
     check_bzrsvn_version()
 
-InterRepository.register_optimiser(fetch.InterFromSvnRepository)
-InterRepository.register_optimiser(commit.InterToSvnRepository)
+optimizers_registered = False
+def lazy_register_optimizers():
+    global optimizers_registered
+    if optimizers_registered:
+        return
+    optimizers_registered = True
+    InterRepository.register_optimiser(fetch.InterFromSvnRepository)
+    InterRepository.register_optimiser(commit.InterToSvnRepository)
 
 def get_scheme(schemename):
     """Parse scheme identifier and return a branching scheme."""
index 297017675e1c465cf3064a712f008f125d827e7b..8d7d2963a264894d0d6402b626bd2c8f99655468 100644 (file)
@@ -268,6 +268,8 @@ class SvnRepository(Repository):
     by using the RA (remote access) API from subversion
     """
     def __init__(self, bzrdir, transport, branch_path=None):
+        from bzrlib.plugins.svn import lazy_register_optimizers
+        lazy_register_optimizers()
         from fileids import SimpleFileIdMap
         _revision_store = None