Rev 467: Implement SvnRaTransport.local_abspath(). (#117090) in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
Jelmer Vernooij
jelmer at samba.org
Sun May 27 20:34:44 BST 2007
At http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
------------------------------------------------------------
revno: 467
revision-id: jelmer at samba.org-20070527193330-0q16hyeiv699y7na
parent: jelmer at samba.org-20070527163512-x5blyfvkewd0pz6d
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Sun 2007-05-27 21:33:30 +0200
message:
Implement SvnRaTransport.local_abspath(). (#117090)
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
tests/test_transport.py test_transport.py-20060621232111-xh7xvoblzsrgj79t-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
=== modified file 'NEWS'
--- a/NEWS 2007-05-21 12:41:26 +0000
+++ b/NEWS 2007-05-27 19:33:30 +0000
@@ -26,6 +26,10 @@
This should reduce the number of roundtrips significantly when
finding file id mappings.
+ INTERNALS
+
+ * Implement SvnRaTransport.local_abspath() (#117090)
+
bzr-svn 0.3.4 UNRELEASED
BUG FIXES
=== modified file 'tests/test_transport.py'
--- a/tests/test_transport.py 2007-05-17 16:52:31 +0000
+++ b/tests/test_transport.py 2007-05-27 19:33:30 +0000
@@ -156,6 +156,11 @@
t = SvnRaTransport("%s/dir" % repos_url)
root = t.get_repos_root()
self.assertEqual(repos_url, root)
+
+ def test_local_abspath(self):
+ repos_url = self.make_client('d', 'dc')
+ t = SvnRaTransport("%s" % repos_url)
+ self.assertEquals(os.path.join(self.test_dir, "d"), t.local_abspath('.'))
class UrlConversionTest(TestCase):
=== modified file 'transport.py'
--- a/transport.py 2007-05-17 16:52:31 +0000
+++ b/transport.py 2007-05-27 19:33:30 +0000
@@ -16,7 +16,7 @@
"""Simple transport for accessing Subversion smart servers."""
from bzrlib.errors import (NoSuchFile, NotBranchError, TransportNotPossible,
- FileExists)
+ FileExists, NotLocalUrl)
from bzrlib.trace import mutter
from bzrlib.transport import Transport
import bzrlib.urlutils as urlutils
@@ -295,3 +295,14 @@
return SvnRaTransport(self.base)
return SvnRaTransport(urlutils.join(self.base, offset))
+
+ def local_abspath(self, relpath):
+ """See Transport.local_abspath()."""
+ absurl = self.abspath(relpath)
+ if self.base.startswith("file:///"):
+ return urlutils.local_path_from_url(absurl)
+ raise NotLocalUrl(absurl)
+
+ def abspath(self, relpath):
+ """See Transport.abspath()."""
+ return urlutils.join(self.base, relpath)
More information about the bazaar-commits
mailing list