Merge fix for 115026
[jelmer/subvertpy.git] / __init__.py
index aa44ad0541415260a29ede590c0d476fd77383a2..ba74d16a0450b84abcc309e7970f556f3af8c476 100644 (file)
@@ -24,7 +24,7 @@ import bzrlib
 
 from bzrlib.trace import warning
 
-__version__ = '0.3.4'
+__version__ = '0.4.0'
 COMPATIBLE_BZR_VERSIONS = [(0, 15), (0, 16), (0, 17)]
 
 def check_bzrlib_version(desired):
@@ -76,19 +76,18 @@ from bzrlib.bzrdir import BzrDirFormat
 
 from bzrlib.repository import InterRepository
 
-from fetch import InterSvnRepository
+from fetch import InterFromSvnRepository
+from commit import InterToSvnRepository
 
 BzrDirFormat.register_control_format(format.SvnFormat)
 
 import svn.core
 _subr_version = svn.core.svn_subr_version()
 
-if _subr_version.major == 1 and _subr_version.minor < 4:
-    warning('Subversion version too old for working tree support.')
-else:
-    BzrDirFormat.register_control_format(checkout.SvnWorkingTreeDirFormat)
+BzrDirFormat.register_control_format(checkout.SvnWorkingTreeDirFormat)
 
-InterRepository.register_optimiser(InterSvnRepository)
+InterRepository.register_optimiser(InterFromSvnRepository)
+InterRepository.register_optimiser(InterToSvnRepository)
 
 from bzrlib.branch import Branch
 from bzrlib.commands import Command, register_command, display_command, Option
@@ -175,16 +174,14 @@ register_command(cmd_svn_upgrade)
 def test_suite():
     from unittest import TestSuite
     import tests
-
     suite = TestSuite()
-
     suite.addTest(tests.test_suite())
-
     return suite
 
 if __name__ == '__main__':
     print ("This is a Bazaar plugin. Copy this directory to ~/.bazaar/plugins "
           "to use it.\n")
+    runner = unittest.TextTestRunner()
+    runner.run(test_suite())
 else:
-    sys.path.append(os.path.dirname(__file__))
-
+    sys.path.append(os.path.dirname(os.path.abspath(__file__)))