Attached is a bundle for the 0.90 branch that attempts to fix this
issue.
The commit message hopefully explains the issue and the fix quite well,
but I am not sure it is the correct one, specifically is it now being
too lenient, in that it will allow two URIs to match that refer to
different ports?
There is also another case that seems like it may also cause issues,
namely _reuse_for in bzrlib/transport/__init__.py, as that compares
self._port to the output of _split_url. If someone that understands the
transport framework better than me could evaluate whether this could
cause bugs that would be great.
The reason the tests didn't get this bug in the first place is that the
implementation tests use urls with a specific, non-default port, which
doesn't trigger the issue, and the general tests didn't use bzr://.
+ def test_relpath_when_transport_uses_a_port(self):
+ """If no port is specified then it is the same as the default.
+
+ When the transport uses a port then relpath assumes that
+ the request must have the same port, otherwise it is not a child.
+ However if the request has no port then the default port is
+ used, and this will match what the server is listening on.
+ """
+ t = RemoteTCPTransport('bzr://host.com/')
+ self.assertEquals(t.relpath('bzr://host.com/'), '')
+
def test_connection_sharing_propagate_credentials(self):
t = ConnectedTransport('foo://<email address hidden>/abs/path') self.assertIs(None, t._get_connection())
=== modified file 'bzrlib/transport/__init__.py'
--- bzrlib/transport/__init__.py 2007-08-09 03:23:04 +0000
+++ bzrlib/transport/__init__.py 2007-08-23 19:12:30 +0000
@@ -1267,7 +1267,7 @@ error.append('user name mismatch')
if (host != self._host): error.append('host mismatch')
- if (port != self._port):
+ if (port is not None and port != self._port): error.append('port mismatch')
if not (path == self._path[:-1] or path.startswith(self._path)): error.append('path mismatch')
Hi,
Attached is a bundle for the 0.90 branch that attempts to fix this
issue.
The commit message hopefully explains the issue and the fix quite well,
but I am not sure it is the correct one, specifically is it now being
too lenient, in that it will allow two URIs to match that refer to
different ports?
There is also another case that seems like it may also cause issues, transport/ __init_ _.py, as that compares
namely _reuse_for in bzrlib/
self._port to the output of _split_url. If someone that understands the
transport framework better than me could evaluate whether this could
cause bugs that would be great.
The reason the tests didn't get this bug in the first place is that the
implementation tests use urls with a specific, non-default port, which
doesn't trigger the issue, and the general tests didn't use bzr://.
Thanks,
James
-- jameswestby. net/ M*edCX/ .A:n*N! >|&7U.L# 9E)Tu)T0> AM - secp256r1/nistp256
James Westby -- GPG Key ID: B577FE13 -- http://
seccure key - (3+)k7|
# Bazaar merge directive format 2 (Bazaar 0.90) bazaar- vcs.org/ bzr/bzr. 0.90/ 2baa224351ca432 3d9481bad3
# revision_id: <email address hidden>-\
# b62gwlx3souge25q
# target_branch: http://
# testament_sha1: efb96fa837eea94
# timestamp: 2007-08-23 20:12:44 +0100
# base_revision_id: <email address hidden>
#
# Begin patch
=== modified file 'NEWS'
--- NEWS 2007-08-21 20:54:11 +0000
+++ NEWS 2007-08-23 19:12:30 +0000
@@ -18,6 +18,11 @@
from the developer document catalog back to the main one.
(Ian Clatworthy, Sabin Iacob, Alexander Belchenko)
+ BUGFIXES:
+
+ * Make the bzr:// transport work again for some operations (e.g. info)
+ when using the default port. (James Westby, #133965)
+
bzr 0.90rc1 2007-08-14 ======= ======= ==
======
=== modified file 'bzrlib/ tests/test_ transport. py' tests/test_ transport. py 2007-07-22 15:44:59 +0000 tests/test_ transport. py 2007-08-23 19:12:30 +0000 transport. memory import MemoryTransport transport. local import (LocalTransport,
EmulatedWin32 LocalTransport) transport. remote import RemoteTCPTransport
--- bzrlib/
+++ bzrlib/
@@ -54,6 +54,7 @@
from bzrlib.
from bzrlib.
+from bzrlib.
# TODO: Should possibly split transport-specific tests into their own files. ort('sftp:// host.com/ dev/%path')
self. assertEquals( t.relpath( 'sftp:// host.com/ dev/%path/ sub'), 'sub')
@@ -665,6 +666,17 @@
t = ConnectedTransp
+ def test_relpath_ when_transport_ uses_a_ port(self) : ort('bzr: //host. com/') ls(t.relpath( 'bzr:// host.com/ '), '') _sharing_ propagate_ credentials( self): ort('foo: //<email address hidden>/abs/path')
self. assertIs( None, t._get_ connection( ))
+ """If no port is specified then it is the same as the default.
+
+ When the transport uses a port then relpath assumes that
+ the request must have the same port, otherwise it is not a child.
+ However if the request has no port then the default port is
+ used, and this will match what the server is listening on.
+ """
+ t = RemoteTCPTransp
+ self.assertEqua
+
def test_connection
t = ConnectedTransp
=== modified file 'bzrlib/ transport/ __init_ _.py' transport/ __init_ _.py 2007-08-09 03:23:04 +0000 transport/ __init_ _.py 2007-08-23 19:12:30 +0000
error. append( 'user name mismatch')
error. append( 'host mismatch')
error. append( 'port mismatch') (self._ path)):
error. append( 'path mismatch')
--- bzrlib/
+++ bzrlib/
@@ -1267,7 +1267,7 @@
if (host != self._host):
- if (port != self._port):
+ if (port is not None and port != self._port):
if not (path == self._path[:-1] or path.startswith
# Begin bundle 2aXNpb24gYnVuZG xlIHY0CiMKQlpoO TFBWSZTWZFLJ84A A3JfgFQQef/ //1v3 wYAfzujcM+ OVRbmru5wtu5x1p kmoSSCRqeUzCmTa nlNMU/RE/ UpsKMD1CGJ6no02 oEpNA AaADQANACKehI0M hkNDTI0NNANAABp iDEaYSIhGiaEymm U0eJ5NU9TanqA0A M gIYBNMIwTEyGmRo aASRE0AJk0aTSZi ap5qnqPUNNM00n6 ptQABtRwJQ5MjYw 0 svudHunHktarHOd nbprC9IgxFZzU5r tr4H9YgE47rq6U3 Rk2EnSv1Xc8V/ DgT4sASi 2202tPYLOmEwvXz wt73votWUNZCyYZ k0s+qmc2VR4jh5r YCBAEDCI+ jVwsAsU bciLwDdiM/ ftbFYEYROA+ vXjOjxaPdN7tv4T Z7cLmj8tVbXDy7M 1v13MKYbo1 8Vp7Msy5lfIU1el rY3o3XG1HE1tUih DpwygDX5QfahOET naMGITY5bmZQXJV 2 69ETBa573tk9Q1y CHo2QgIK+ RjvtP5OiNsgO5qc elq2jm7OALXZ2Sc 7XXDog1L Vj8cuSfRfTGMKHn p3cKFYuCkJ+ IklxskR8mF+ eVbEx/SNgdMCuWd b0RLbtFrd 0YkhcZWbliaYhqg nNIxgp2ZYWAGGnn aS2SzAIWGWBLIKH nzttE6wpJfCdWGZ Y LffivYDUqek4lcb iy0xKdcTQXS7LBG D3hiQHMXLKC5cwF VNiWzyNZJ4KJdER c noGNNR3WCMM1bOP QTXiLxlFgTKQxKs VIPrxbbspF5k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