[MERGE] Clean up Branch.sprout
John Arbash Meinel
john at arbash-meinel.com
Thu Aug 28 21:12:48 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> Hi all,
>
> The way BzrBranch.sprout works is a little odd. It always uses the
> source branch's format, even when the target metadir's branch format is
> different.
>
> This patch allows the target metadir to control the format. It is a
> prerequisite for my upcoming patch to re-enable stacking policies.
>
> In the process of fixing this, I also had to fix BzrDir5/6 so that
> BzrDir.create_branch actually ran BranchFormat.initialize. I don't know
> why it wasn't doing that.
If I was guessing, it was because they were all-in-one formats, and so the
branch was already created just by creating the BzrDir. Not 100% sure, though.
>
> Aaron
branch = self.open_branch()
source_repository = branch.repository
+ result_format._branch_format = branch._format.__class__()
^- Is there a problem with doing:
result_format._branch_format = branch._format
It seems a bit more obvious, and I thought the Format objects were meant to be
(mostly) singletons anyway. (We are a bit inconsistent about this, IIRC.)
BB:tweak
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFItwbAJdeBCYSNAAMRAtsTAJ41m8gbyUeCWhRPbcTIC0o1hMvb+ACdFODY
RAFmJ8pd7TwQ1qcRtm2uk0I=
=xof+
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list