[BUG](regression) 'bzr pull' into a bound branch fails

John Arbash Meinel john at arbash-meinel.com
Fri Oct 19 20:31:42 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a branch bound to a bzr+ssh branch. When I do "bzr pull --overwrite" in
that branch, I get an SSH connection failure.

I used Martin's wonderful ^| (SIGQUIT) work, to break in, and it seems that I'm
ending up with:

(Pdb) transport
<bzrlib.transport.remote.RemoteSSHTransport
url=bzr+ssh://juju/srv/bzr/public/branches/bzr/jam-integration/>

Which looks okay, until I dig deeper:
(Pdb) transport._host
''

(Pdb) transport._path
'//juju/srv/bzr/public/branches/bzr/jam-integration/'


(I had a sneaking suspicion because it was asking to connect with the wrong
username. Using the default value, rather than the one configured for that host.)

Does anyone have an idea how this could happen? I'm thinking it has to do with
Vila's recent patch. Specifically, I think it is calling _split_url before it
is importing bzrlib/transport/remote.py
Which means that this line hasn't run yet:
# must do this otherwise urllib can't parse the urls properly :(
for scheme in ['ssh', 'bzr', 'bzr+loopback', 'bzr+ssh',
	       'bzr+http', 'bzr+https']:
    transport.register_urlparse_netloc_protocol(scheme)
del scheme


And I think the reason for that is because possible_transports is not empty
(because it is a bound branch opening its master). So the _split_url stuff is
called to see if the other transport can be reused *Before* it actually tries
to open the connection.

Any decent ideas about how this could be fixed? The easiest way is:
=== modified file 'bzrlib/transport/__init__.py'
- --- bzrlib/transport/__init__.py        2007-10-09 08:43:47 +0000
+++ bzrlib/transport/__init__.py        2007-10-19 19:29:20 +0000
@@ -1788,6 +1788,11 @@
             help="Fast access using the Bazaar smart server.",
             default_port=4155)

+# must do this otherwise urllib can't parse the urls properly :(
+for scheme in ['ssh', 'bzr', 'bzr+loopback', 'bzr+ssh', 'bzr+http', 'bzr+https']:
+    register_urlparse_netloc_protocol(scheme)
+del scheme
+
 register_lazy_transport('bzr://',
                         'bzrlib.transport.remote',
                         'RemoteTCPTransport')

=== modified file 'bzrlib/transport/remote.py'
- --- bzrlib/transport/remote.py  2007-10-05 14:52:02 +0000
+++ bzrlib/transport/remote.py  2007-10-19 19:29:05 +0000
@@ -36,11 +36,6 @@
     )
 from bzrlib.smart import client, medium, protocol

- -# must do this otherwise urllib can't parse the urls properly :(
- -for scheme in ['ssh', 'bzr', 'bzr+loopback', 'bzr+ssh', 'bzr+http',
'bzr+https']:
- -    transport.register_urlparse_netloc_protocol(scheme)
- -del scheme
- -

Basically, the schemes need to be registered where the protocol is registered.
Rather than in the file they are imported in. (In bzrlib/transport/__init__.py
rather than in bzrlib/transport/<protocol>.py)

Thoughts?

John
=:->

  affects bzr
  status triaged
  priority critical

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHGQYeJdeBCYSNAAMRAh16AKCOwTPkb4g7XS5TBZER8I2qb1p8bQCeIy1C
91mV7rLPMkAzhGAuysxVKf0=
=wZ8L
-----END PGP SIGNATURE-----



More information about the bazaar mailing list