Rev 464: More work getting own file:// svn implementation to work. in file:///data/jelmer/bzr-svn/native/

Jelmer Vernooij jelmer at samba.org
Wed Mar 19 23:50:53 GMT 2008


At file:///data/jelmer/bzr-svn/native/

------------------------------------------------------------
revno: 464
revision-id: jelmer at samba.org-20080319235052-pg0anzu0j319iur9
parent: jelmer at samba.org-20080319224919-bu37ta819wi4wj5p
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: native
timestamp: Thu 2008-03-20 00:50:52 +0100
message:
  More work getting own file:// svn implementation to work.
modified:
  __init__.py                    __init__.py-20051008155114-eae558e6cf149e1d
  tests/test_workingtree.py      test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
  transport.py                   transport.py-20060406231150-b3472d06b3a0818d
  transport_file.py              transport_file.py-20070202195533-c5p5vi6yie11tsax-1
  workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file '__init__.py'
--- a/__init__.py	2008-03-19 17:15:58 +0000
+++ b/__init__.py	2008-03-19 23:50:52 +0000
@@ -74,10 +74,16 @@
     help="Access of Subversion smart servers over secure HTTP.")
 register_transport_proto('svn://', 
     help="Access using the Subversion smart server.")
-register_lazy_transport('svn://', 'bzrlib.plugins.svn.transport', 
-                        'SvnRaTransport')
-register_lazy_transport('svn+', 'bzrlib.plugins.svn.transport', 
-                        'SvnRaTransport')
+register_lazy_transport('svn://', 'bzrlib.plugins.svn.transport_svn', 
+                        'SvnRaTransportSvn')
+register_lazy_transport('svn+file://', 'bzrlib.plugins.svn.transport_file',
+                        'SvnRaTransportFile')
+register_lazy_transport('svn+http://', 'bzrlib.plugins.svn.transport_http', 
+                        'SvnRaTransportHttp')
+register_lazy_transport('svn+https://', 'bzrlib.plugins.svn.transport_http', 
+                        'SvnRaTransportHttp')
+register_lazy_transport('svn+ssh://', 'bzrlib.plugins.svn.transport_svn', 
+                        'SvnRaTransportSvn')
 topic_registry.register_lazy('svn-branching-schemes', 
                              'bzrlib.plugins.svn.scheme',
                              'help_schemes', 'Subversion branching schemes')

=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py	2008-03-16 04:31:39 +0000
+++ b/tests/test_workingtree.py	2008-03-19 23:50:52 +0000
@@ -29,7 +29,7 @@
 
 import os, sys
 
-from transport import svn_config
+from transport_native import svn_config
 from tests import TestCaseWithSubversionRepository
 
 class TestWorkingTree(TestCaseWithSubversionRepository):

=== modified file 'transport.py'
--- a/transport.py	2008-03-19 22:49:07 +0000
+++ b/transport.py	2008-03-19 23:50:52 +0000
@@ -37,15 +37,16 @@
         from transport_http import SvnRaTransportHttp
         return SvnRaTransportHttp(bzr_transport.base)
 
+    if (bzr_transport.base.startswith('file://') or 
+        bzr_transport.base.startswith('svn+file://')):
+        from transport_file import SvnRaTransportFile
+        return SvnRaTransportFile(bzr_transport.base)
+
     if (bzr_transport.base.startswith('svn://') or 
         bzr_transport.base.startswith('svn+')):
         from transport_svn import SvnRaTransportSvn
         return SvnRaTransportSvn(bzr_transport.base)
 
-    if bzr_transport.base.startswith('file://'):
-        from transport_file import SvnRaTransportFile
-        return SvnRaTransportFile(bzr_transport.base)
-
     raise AssertionError("Unknown url scheme passed to get_svn_ra_transport()")
 
 
@@ -67,9 +68,6 @@
     
     This implements just as much of Transport as is necessary 
     to fool Bazaar. """
-    def __init__(self, url="", _backing_url=None):
-        raise NotImplementedError
-
     def has(self, relpath):
         """See Transport.has()."""
         # TODO: Raise TransportNotPossible here instead and 

=== modified file 'transport_file.py'
--- a/transport_file.py	2008-03-19 22:49:07 +0000
+++ b/transport_file.py	2008-03-19 23:50:52 +0000
@@ -14,6 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from bzrlib.urlutils import local_path_from_url
 import repos
 from transport import SvnRaTransport
 
@@ -24,9 +25,11 @@
 
 class SvnRaTransportFile(SvnRaTransport):
     """Subversion Local File Transport."""
-    def __init__(self, url=""):
-        # FIXME: Convert URL to path
-        self.fs = repos.Repository(local_path)
+    def __init__(self, url):
+        super(SvnRaTransportFile, self).__init__(url)
+        local_path = local_path_from_url(url.lstrip("svn+"))
+        self.repos = repos.Repository(local_path.rstrip("/"))
+        self.fs = self.repos.fs()
 
     def get_uuid(self):
         return self.fs.get_uuid()

=== modified file 'workingtree.py'
--- a/workingtree.py	2008-03-18 23:27:43 +0000
+++ b/workingtree.py	2008-03-19 23:50:52 +0000
@@ -45,7 +45,8 @@
 from svk import SVN_PROP_SVK_MERGE, parse_svk_features, serialize_svk_features
 from mapping import escape_svn_path
 from scheme import BranchingScheme
-from transport import (SvnRaTransport, bzr_to_svn_url, svn_config) 
+from transport import (SvnRaTransport, bzr_to_svn_url) 
+from transport_native import svn_config
 from tree import SvnBasisTree
 
 import os




More information about the bazaar-commits mailing list