[MERGE] Restore default stacking policy support
John Arbash Meinel
john at arbash-meinel.com
Thu Aug 28 21:44:18 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> Hi all,
>
> This patch restores support for stacking policies to the branch command.
To be pedantic, bzr.dev never had stacking policies removed. Only the 1.6
branch. I *am* happy to see this cleaned up.
+ * ``bzr branch`` now respects default stacking policies. (Aaron Bentley)
+
^- ``bzr branch`` uses the default stacking policy if the branch format
supports it.
Perhaps?
> I've reorganized the code a bit so that:
>
> 1. The target bzrdir has full control over the formats of branches and
> repositories it creates.
> 2. Formats are only overridden if the user specifies --stack, not when
> there is a default stacking policy.
>
> Unfortunately, Branch.sprout likes to access the repository, and this
> happens before stacking can be configured on the branch. I have
> overridden this for now, but I think we probably need to look at a
> different approach to Sprout. Perhaps extending RepositoryPolicies so
> that they can be configured with all the requirements would make sense.
> Other ideas are welcome.
>
> In the process, I've discovered that --1.6-rich-root uses the wrong
> serializer. This means that it cannot stack on top of rich-root-pack.
> It also means that it may not reliably refuse inventories containing
> subtrees. I have filed a bug here:
> https://bugs.launchpad.net/bzr/+bug/262333
>
> Aaron
+ def _get_metadir(self, require_stacking=False):
^- I'm not sure about the name of this function. It doesn't seem clear what
the difference is between this and "cloning_metadir". Is there a reason to not
just update the api of "cloning_metadir" to take a "require_stacking" parameter?
...
+ cloning_format.get_branch_format().supports_stacking()):
+ # We need to make a stacked branch, but the default format for the
+ # target doesn't support stacking. So force a branch that *can*
+ # support stacking.
+ from bzrlib.branch import BzrBranchFormat7
+ cloning_format._branch_format = BzrBranchFormat7()
^- I realize this is somewhat necessary, but it does feel a bit odd to be
hard-coding Format7. I know we have the bug open about 'subtree/rich-root',
but as we add more branch formats it seems like we have to keep updating this.
Would it be possible to have a single recommended-for-stacking registry rather
than hard-coding this? (This is not a blocking issue, this is just being
raised for discussion.)
Otherwise it seems fine, I *do* like having a single function for upgrading to
a stackable BzrDir, rather than having the functionality spread into multiple
places.
BB:tweak
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFItw4iJdeBCYSNAAMRAgAUAKCLZ/3121e4n6RtXN9ibFNXNZ/mJACgx9Hm
mC9wd5c4YiD+3j+g7lcfVGg=
=rP02
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list