Rev 2401: Split out the improvement to Transport.local_abspath to raise NotLocalURL from the hpss-faster-copy branch. (Martin Pool, Ian Clatworthy) in file:///home/robertc/source/baz/misc-fixen/
Robert Collins
robertc at robertcollins.net
Thu Apr 5 04:07:11 BST 2007
At file:///home/robertc/source/baz/misc-fixen/
------------------------------------------------------------
revno: 2401
revision-id: robertc at robertcollins.net-20070405030706-9zpyygdfimm020u8
parent: pqm at pqm.ubuntu.com-20070404213903-fe78a7a55c37ee95
committer: Robert Collins <robertc at robertcollins.net>
branch nick: misc-fixen
timestamp: Thu 2007-04-05 13:07:06 +1000
message:
Split out the improvement to Transport.local_abspath to raise NotLocalURL from the hpss-faster-copy branch. (Martin Pool, Ian Clatworthy)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
=== modified file 'NEWS'
--- a/NEWS 2007-04-04 14:05:24 +0000
+++ b/NEWS 2007-04-05 03:07:06 +0000
@@ -25,6 +25,9 @@
* Convenience method TestCase.expectFailure ensures that known failures
do not silently pass. (Aaron Bentley)
+ * Transport.local_abspath now raises NotLocalUrl rather than
+ TransportNotPossible. (Martin Pool, Ian Clatworthy)
+
BUGFIXES:
* Don't fail bundle selftest if email has 'two' embedded.
=== modified file 'bzrlib/tests/test_transport_implementations.py'
--- a/bzrlib/tests/test_transport_implementations.py 2007-04-01 06:19:16 +0000
+++ b/bzrlib/tests/test_transport_implementations.py 2007-04-05 03:07:06 +0000
@@ -30,10 +30,17 @@
osutils,
urlutils,
)
-from bzrlib.errors import (DirectoryNotEmpty, NoSuchFile, FileExists,
- LockError, NoSmartServer, PathError,
- TransportNotPossible, ConnectionError,
- InvalidURL)
+from bzrlib.errors import (ConnectionError,
+ DirectoryNotEmpty,
+ FileExists,
+ InvalidURL,
+ LockError,
+ NoSmartServer,
+ NoSuchFile,
+ NotLocalUrl,
+ PathError,
+ TransportNotPossible,
+ )
from bzrlib.osutils import getcwd
from bzrlib.symbol_versioning import zero_eleven
from bzrlib.tests import TestCaseInTempDir, TestSkipped
@@ -1109,7 +1116,7 @@
transport = self.get_transport()
try:
p = transport.local_abspath('.')
- except TransportNotPossible:
+ except NotLocalUrl:
pass # This is not a local transport
else:
self.assertEqual(getcwd(), p)
=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py 2007-04-01 06:19:16 +0000
+++ b/bzrlib/transport/__init__.py 2007-04-05 03:07:06 +0000
@@ -403,9 +403,7 @@
This function will only be defined for Transports which have a
physical local filesystem representation.
"""
- # TODO: jam 20060426 Should this raise NotLocalUrl instead?
- raise errors.TransportNotPossible('This is not a LocalTransport,'
- ' so there is no local representation for a path')
+ raise errors.NotLocalUrl(self.abspath(relpath))
def has(self, relpath):
"""Does the file relpath exist?
More information about the bazaar-commits
mailing list