[MERGE][bug #75721](0.17) "bzr push" should only connect 1 time

John Arbash Meinel john at arbash-meinel.com
Wed May 2 00:00:38 BST 2007


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

The attached patch fixes:
https://bugs.launchpad.net/bzr/+bug/75721

And probably has a positive influence on

https://bugs.launchpad.net/bzr/+bug/86392

Basically, we were passing around a URL rather than a Transport. Because
we didn't have the api's to pass around a Transport. Which caused us to
connect 3 times (in the past it was 4 times).

We didn't notice with SFTP because of the connection cache.

I don't have a specific test that we don't connect multiple times,
because that seems a little invasive, and I wasn't sure how to do it.
(spy on get_transport() calls and assert that there is only 1?). If it
is done, should it be parameterized by the BzrDir format? Is it an
end-to-end test of the 'bzr push' command.

I chose to go the "add an api, test it, and start using it". I ensured
it was correct by adding a "import pdb; pdb.set_trace()" call in
bzrlib/medium.py after _ensure_connection(). Which isn't how I would
want to write a real test.

I think this will help make 'bzr push' quite a bit more responsive over
a slow link (when there is only a little bit to push, obviously it
doesn't help the whole "initial push" problem).

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGN8aWJdeBCYSNAAMRAn2bAKDTfuDFy0vPKyTJ0tqG8iqDhU7CzACguNtw
0zlU1qsFDIa6+CKS8zReO00=
=LzSN
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: single_connect_for_push_75721.patch
Type: text/x-patch
Size: 7695 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070501/70f85f9b/attachment.bin 


More information about the bazaar mailing list