[MERGE] "Branch.open()" should re-use the connection for stacked branches

John Arbash Meinel john at arbash-meinel.com
Thu Jan 8 19:16:08 GMT 2009


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

So in starting to use stacked branches, I noticed that just connecting
to one causes us to open the connection multiple times. (Thanks to
paramiko actually printing the connection each time.)

It turns out that doing "bzr push" to a new stacked branch actually
connects at least 4 times. Pushing to an existing branch connects 2 times.

I managed to track down one of the places. We were calling BzrDir.open()
without passing the current transport as a possible transport to re-use.

With this patch, 'bzr push' to an existing stacked branch only connects
once, while pushing to a new stacked branch does still connect 2 times.
But at least that is down from 4 times.

Also, in this patch I pulled out a lot of the common error handling in
test_stacking. Basically, every test needs to catch the exception about
not supporting stacking, and I pulled out some of the common code.

It is unfortunate that we have to spend the time creating 2 branches
over an SFTP transport before we can get to the point of realizing they
aren't stackable (TestCaseWithConnectionHookedTransport uses SFTP to
actually track the number of connections). But it works.

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

iEYEARECAAYFAklmUPgACgkQJdeBCYSNAAPKwgCgsGBvDWnkieBaKlGT4qCrylLr
dlMAniG+xAw7trXu1JMmrOyZFh+vWzMW
=tDQC
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stacking_tweaks.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20090108/2bb35244/attachment-0001.diff 


More information about the bazaar mailing list