[merge][#249256] correct confusion between format classes and objects
John Arbash Meinel
john at arbash-meinel.com
Thu Jul 17 06:11:03 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Martin Pool wrote:
| This patch, started by mwhudson, fixes
| <https://bugs.launchpad.net/bzr/+bug/249256>, problems "sometimes" in
| building a tree from a remote branch. I'm not clear on just when it
| The root cause is the first patch hunk, that _matchingbzrdir should be
| a format instance not a class.
| Fixing this found many knock-on test failures, Michael's fix for which
| changed the way test scenarios are generated, so that when we're
| applying a test to eg a workingtree format, we use the bzrdir format
| specified as matching it. Passing it separately meant that
| _matchingbzrdir was not tested when it should have been. This change
| to the normal scenario generator doesn't prevent code generating other
| scenarios that mix and match formats in different ways, or for example
| tweaking the returned scenarios.
| test_setting_vfs_transport was strictly redundant with the following
| test so I removed it.
| Many of the tests here are passing in for a string (or in one case an
| int) where a Format instance is expected. This happened to pass in
| the old code but now needs to be updated to give a real object.
| I would say in general that it's nice to have apis work by duck
| typing. But if they do expect an object providing a particular
| interface, then the tests ought to provide something matching that
| interface, both to make sure it's exercised realistically, and also to
| make the test easier to understand. Looking at the previous version
| of these tests someone might have expected that it was format names
| that were being passed.
As long as "make_branch_and_tree('path', format='str')" still works, I'm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar