[MERGE] Improve test_sprout_preserves_kind

John Arbash Meinel john at arbash-meinel.com
Tue Nov 18 17:08:28 GMT 2008


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

Aaron Bentley wrote:
> Aaron Bentley has voted abstain.
> Status is now: Semi-approved
> Comment:
> The name of this test is quite misleading.  It is not actually
> preserving a target kind-- it is ensuring that the format can be
> overridden by specifying it.
> 


I believe your contention that it "uses it if it has been specified" is
incorrect, because AFAIK there is no way to leave a BzrDir.branch_format
unspecified. If you create a BzrDir it auto-specifies the default. And
Branch.sprout() always takes an existing BzrDir to sprout into.

We discussed it a bit in Sydney, and I think an ideal api would have the
primary "sprout" be on Branch rather than on BzrDir, but that isn't how
it sits now. So this test is meant to actually enforce the current
behavior. The previous test was succeeding by accident, because of the
inheritance hierarchy. It was always creating a Branch6, but that
happens to be a child of Branch5 and Branch7 so the assertIsInstance()
check always passed. We discovered the problem when we started trying to
change the inheritance hierarchy.

Does the term:

  test_sprout_uses_bzrdir_branch_format(self): ?

Sound better to you?

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

iEYEARECAAYFAkki9owACgkQJdeBCYSNAAO1MQCfav/Km18pGEJ21OLCmWpWdCp2
X/YAn3XaKmHXhK8KFg1tkNJafB7uXOZM
=lR61
-----END PGP SIGNATURE-----



More information about the bazaar mailing list