[Bug 133965] PathNotChild, port mismatch with "bzr info" for bzr:// smartserver

James Westby jw+debian at jameswestby.net
Mon Aug 27 22:18:37 BST 2007


Hi all,

Attached is the fix that I am proposing for 0.90. It is John's fix, with
the parts of Andrew's test case that are appropriate for this fix.
Robert was keen that the same fix be applied to 0.90 and trunk, but I
can't see that a fix has been decided on for trunk. Also this is the fix
that Vincent suggested would be good for this release.

Assuming this is accepted and merged soon I would like to make another
release tomorrow. The question is whether it should be a second release
candidate or the final release. It would normally be a second release
candidate, but there are a couple of factors in play. The first is that
Gutsy is freezing soon, and I guess some people would want 0.90 in the
release. The second is that a release candidate and then a release in a
week means that there will only be one week before the release candidate
of 0.91.

I propose to release a second release candidate tomorrow, but if anyone
feels strongly that it should be the final release please speak up. If
that is the case then perhaps Martin should have the final say in the
matter.

If the second release candidate is decided on then could someone please
merge the second bundle attached in to the 0.90 branch so that it is
ready for me to do the release from it when I get home, and to avoid
unnecessarily dragging out the release further. The third bundle is in
the event that a full release is chosen, it merely updates the date
recorded in NEWS.

Thanks,

James

-- 
  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256
-------------- next part --------------
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: jw+debian at jameswestby.net-20070827210157-\
#   672l6nisr283ybdc
# target_branch: http://bazaar-vcs.org/bzr/bzr.0.90/
# testament_sha1: 5fe509622ea1c6904199e90ff155694122eadee4
# timestamp: 2007-08-27 22:04:22 +0100
# base_revision_id: pqm at pqm.ubuntu.com-20070822004557-ipcsdwnro02sbrpd
# 
# Begin patch
=== modified file 'NEWS'
--- NEWS	2007-08-21 20:54:11 +0000
+++ NEWS	2007-08-27 21:01:57 +0000
@@ -18,6 +18,13 @@
       from the developer document catalog back to the main one.
       (Ian Clatworthy, Sabin Iacob, Alexander Belchenko)
 
+  BUGFIXES:
+
+    * Fix ''bzr info bzr://host/'' and other operations on ''bzr://' URLs with
+      an implicit port.  We were incorrectly raising PathNotChild due to
+      inconsistent treatment of the ''_port'' attribute on the Transport object.
+      (John Arbash Meinel, Andrew Bennetts, #133965)
+
 
 bzr 0.90rc1 2007-08-14
 ======================

=== modified file 'bzrlib/tests/test_transport.py'
--- bzrlib/tests/test_transport.py	2007-07-22 15:44:59 +0000
+++ bzrlib/tests/test_transport.py	2007-08-27 21:01:57 +0000
@@ -54,6 +54,9 @@
 from bzrlib.transport.memory import MemoryTransport
 from bzrlib.transport.local import (LocalTransport,
                                     EmulatedWin32LocalTransport)
+from bzrlib.transport.remote import (BZR_DEFAULT_PORT,
+                                     RemoteTCPTransport,
+                                     )
 
 
 # TODO: Should possibly split transport-specific tests into their own files.
@@ -714,6 +717,31 @@
         self.assertIsNot(t1, t2)
 
 
+class TestRemoteTCPTransport(TestCase):
+    """Tests for bzr:// transport (RemoteTCPTransport)."""
+
+    def test_relpath_with_implicit_port(self):
+        """Connected transports with the same URL are the same, even if the
+        port is implicit.
+
+        So t.relpath(url) should always be '' if t.base is the same as url, or
+        if the only difference is that one explicitly specifies the default
+        port and the other doesn't specify a port.
+        """
+        t_implicit_port = RemoteTCPTransport('bzr://host.com/')
+        self.assertEquals('', t_implicit_port.relpath('bzr://host.com/'))
+        t_explicit_port = RemoteTCPTransport('bzr://host.com:4155/')
+        self.assertEquals('', t_explicit_port.relpath('bzr://host.com:4155/'))
+
+    def test_url_includes_non_default_port(self):
+        """Non-default ports are included in the transport's URL.
+
+        Contrast this to `test_url_omits_default_port`.
+        """
+        t = get_transport('bzr://host.com:666/')
+        self.assertEquals('bzr://host.com:666/', t.base)
+
+
 def get_test_permutations():
     """Return transport permutations to be used in testing.
 

=== modified file 'bzrlib/transport/remote.py'
--- bzrlib/transport/remote.py	2007-07-30 14:36:04 +0000
+++ bzrlib/transport/remote.py	2007-08-27 21:01:57 +0000
@@ -443,9 +443,10 @@
 
     def _build_medium(self):
         assert self.base.startswith('bzr://')
-        if self._port is None:
-            self._port = BZR_DEFAULT_PORT
-        return medium.SmartTCPClientMedium(self._host, self._port), None
+        port = self._port
+        if port is None:
+            port = BZR_DEFAULT_PORT
+        return medium.SmartTCPClientMedium(self._host, port), None
 
 
 class RemoteSSHTransport(RemoteTransport):

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWcaSwikAA8FfgFRQef///3+3
3tD////wYAg7fYd7g8AE3bYbr2Z0qnqq1wBJJEYU2lPyE2im1PU/IBNTxQep6J6TR5QbUaaHkQJJ
AJkGiYqNEPU9TyamgGgAANAAAEohkJNNU9E9BpH6pkwRgCAaGRgAmhgJTSISZMIwQZBkNBo00aAA
0aAAA4aaYIZDTTIyYQDTQBhNGmTAAgaCSIjQKbTI1MCaPSaU8mJPEjQPSNDQBp6TyhhlARUtL6wy
zHmaF/trxwKL18ZKn70bqph5awJEjv/k3V+bNbM1Os8lo6q4Msm6b98tI7TEd7CbyU760JQfJ2D1
2ahJBIEmBsg5lPTBeh8TSU6A2K1MzMyZUbrB5PdAkq56xiKuOEE9L3vKWY8ZvVDEYDK3PE2NAf/9
o5DNRdkqQ9eTtYub80kR1aH9ynsawukFO++fotsR51FSwpcRHjVSQTGIK5ghQi57m7ppUZBqJbrs
7UxKQKCWwTCQhhxxtasyJL4wmxKIqYx0v11n8ssmCOY7qaluDGmoxvR+ZZdQaXleSKuSh99MMhWy
410oYRAhwiGgNECA0bVoe2knmwX3ika0tqzdw0WeG3yiUkuQ0dYKebwuIFdDzUrgYkN4zHVfBkwj
tOfnEeulmNecitBw7Kj4sGb04FFutE5h6JxZtFOAKMGLRg+VS51A3Qwd39qRiHVIDTZYvFExt17K
+6tAzAaW7YxSFUUcgjuIhemNh4KAWU2IPOVRAqmUqiIA5UWzDiUGKgcljEkR7yR7bLPdeFTJ5Wkk
Z5eZ/15aWdn0+ckPBtWpPB1SIlXJxpjycxJFr9mBAo/MOs1NjkdY7i9rmq4ATDzYvpcRWHSblMjy
PpVxmVe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1p4K1czCJhEBMB6gbOWjuKinyAvOUbOLr52oZWGwV/Dm6do7Wo9QiB1
075JEgJqEHTrn+6cIJ4zsW4x/o9KzVWBv8nCZfyuoEqcEI9PisvAmjpaZKOwJkojah5piyBNqcU8
wJ0cQShOJkwvgTBfBagTjoy9vuETlJydCgFYBEQ9DpaE67ONIs1WwmaPecxnTG2MVFIUEersV0Dw
XM92JKPO0JBwa3KJlOcBIIKdBUbkpLCLQ3xWOOKIh1GVqbTguE8bBxxDiQiy8v9AxFRRICYRB2TJ
nEzvn5e5eu8z5xuoUhfqrzhuGOjdCBkEOkPMK0793OJCTJmkL5PHFA0ShXpslVmmYLFXFSasmheJ
qJXpDNmT9Cmyz6AwUgQUrK7jJhly6PzjVi01g0WIeBUwpjR0zEL4zM1Y51rWT151IutVfQr+KNVU
w4LoT5gWcgsiLZiIBMIoiMt1T6YsAwImKhOmYF2csSZZsKo+ZHq0iUmCeM5Ilq9mMyInIczjYwqP
yIqr3Y0gOdVUYaXlFi5UYSw5GiyMoG3o22b+93vFl59FshmghYpm0HDzIi4eshbJxzZtDuhFh46s
2ePMHuQ6BgdCCaJJfAsF23GJadKhidiy8elzOIV8barxDgXpAr4FgTKt15+dDWojN1eLuXaKIKEG
8Ii/w/Uc9rZBlVJf+LuSKcKEhjSWEUg=
-------------- next part --------------
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: jw+debian at jameswestby.net-20070827211557-\
#   jyr8fuzke8xw4hj3
# target_branch: http://bazaar-vcs.org/bzr/bzr.0.90/
# testament_sha1: 30a48064eb4d858e2321c50e7d36f97910686cb6
# timestamp: 2007-08-27 22:16:26 +0100
# base_revision_id: pqm at pqm.ubuntu.com-20070822004557-ipcsdwnro02sbrpd
# 
# Begin patch
=== modified file 'NEWS'
--- NEWS	2007-08-21 20:54:11 +0000
+++ NEWS	2007-08-27 21:15:57 +0000
@@ -4,8 +4,8 @@
 
 .. contents::
 
-bzr 0.90 2007-08-22
-===================
+bzr 0.90rc2 2007-08-28
+======================
 
   IMPROVEMENTS:
 

=== modified file 'bzrlib/__init__.py'
--- bzrlib/__init__.py	2007-08-21 20:54:11 +0000
+++ bzrlib/__init__.py	2007-08-27 21:15:57 +0000
@@ -35,7 +35,7 @@
 # Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
 # releaselevel of 'dev' for unreleased under-development code.
 
-version_info = (0, 90, 0, 'final', 0)
+version_info = (0, 90, 0, 'candidate', 1)
 
 # API compatibility version: bzrlib is currently API compatible with 0.18.
 api_minimum_version = (0, 18, 0)

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWf+yeSQAAg5/gAAQEABR7///
WhEIgL////BQBDieAGbBVsoElKnmqbTA0p6hptMjKeU9Q0NNNNNDNIOYAAAAAAAAAAEiKZTTUeho
p7Un4qGhoaMhp6jIaAOYAAAAAAAAAAEkiDTTJoBRiU20aCnqZim1Bpo0NhhoXUj7cDt7MeFVcmuZ
5dGd82WUBWmTjOZrrPR/coniu084xtsp3/jkHjW2sZ0wvsY3WKSQVy8eUPnZ4bcM4UbomkBpygJY
791evG2bu7y9FekuG8kEccJBZ7XMWeDFIgL2V/M5ORH4mAZbk4gSOEhNjI1hiq5Uj7UqoUZqbEbU
NSIWTevRrZVYJEBqHrlpSzEKvAgUHCXkuRE9vD9eCFBdCCmdk5Hl6PpHVPZFp5RLEGGQ4JTzNrT4
vKJxGSBs5m51V/Igqx5kXmo8fKm2a3RUyFYabAaMaogtHZsBCcYpYESpfcURiY9MxNi4vKSJzLCb
jAmYBgf8VWFqZTMg6hww8qWM/mQfJGWIwx+YFVDHPMkih/hw45VmwxFPA6iCRXArqMi82NjY7C4i
YkXy4FNRty2QVERxDK8EyFDUCwwH1LAmYjrnlxENdaECwuIDDyeFRRmV8qrIQT6nIZgKyEi45ULs
i41LasDQ5AOAvkVY4KZpqZ2YESotNrClhkZmRaZNXCAyYHq9Yor8z2VbJe7H00v/GcMtIxna237h
q016eC6/VNsFriZSPetRYmx/ndH6Wouf7VVv+K3qlXcTzhRSiL+6htZr6rBdRmaGY8eT95ofJZCl
Gty5eiRO+kNvHQxJRFS0mGW4wLzoeBaOPEY8i07LTsJpHb1r3W4Lx8q3JWSG64lDmdXxTIoUrPy3
c3orZ8V3nN8Kn5yMDuGO0tCZYGo/rKARNC4kcT7pF+cSte+yyb1O/8P+RUbFOeQbj3GQ42P4A1PM
z8VQ408FiVIzcSSNDTLPuD90wrKStr6gpyGXr9UhyRokRvQRRVno2pwPM7TU1NA8ZFkHLeWlxOMW
68CsfuSoP45OKhc2w9gEiH9eyRzdP6i5Fgy3E406IjYH23fXiI+y70El21E3gBzSN5x7TgbgYRgU
nmBQiMLRYFNm2zq2L/CqqhszulIeOqd6slEpDRkoiUQR9EiSeDl81iDmFinLmc6BuFQht3oqRWvV
ynjQzzzCSirFaF0+S4QIxG1VoqatmcgGkjp7dmhBKXc8vanXXmuXpWNmwL1qVWNP7jqN9J3rsPMs
DbxC9aAcmcRC9JViZItZIu5vLVl+gYIVQ66QW/A7LAcoIuE9giycQXFenPZQcBjBcXIN0jECxIgt
iBYj6ARnPrT0h726EgOhvmu8C+5f+LuSKcKEh/2TySA=
-------------- next part --------------
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: jw+debian at jameswestby.net-20070827211741-\
#   r1lgdit95z8zujk9
# target_branch: http://bazaar-vcs.org/bzr/bzr.0.90/
# testament_sha1: a5b4e034b695bd695f2c370c18f7f965ab09d95f
# timestamp: 2007-08-27 22:17:55 +0100
# base_revision_id: pqm at pqm.ubuntu.com-20070822004557-ipcsdwnro02sbrpd
# 
# Begin patch
=== modified file 'NEWS'
--- NEWS	2007-08-21 20:54:11 +0000
+++ NEWS	2007-08-27 21:17:41 +0000
@@ -4,7 +4,7 @@
 
 .. contents::
 
-bzr 0.90 2007-08-22
+bzr 0.90 2007-08-28
 ===================
 
   IMPROVEMENTS:

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGx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