[MERGE][#270397] Fix branch --stacked from a branch on a smart server. Also, a question about branch.sprout.

John Arbash Meinel john at arbash-meinel.com
Mon Oct 27 19:19:56 GMT 2008

Hash: SHA1

> It's enough to fix <https://bugs.launchpad.net/bzr/+bug/270397>, but I think we
> need to do more than I've done here.  The tests in
> branch_implementations.test_sprout should really cover this behaviour as well.
> In fact there's already a test that looks like it tests the contract here, but
> it's misleading:
>     def test_sprout_preserves_kind(self):
>         branch1 = self.make_branch('branch1')
>         target_repo = self.make_repository('branch2')
>         target_repo.fetch(branch1.repository)
>         branch2 = branch1.sprout(target_repo.bzrdir)
>         if isinstance(branch1, remote.RemoteBranch):
>             branch1._ensure_real()
>             target_class = branch1._real_branch.__class__
>         else:
>             target_class = branch1.__class__
>         self.assertIsInstance(branch2, target_class)
> The contract isn't simply “sprout preserves kind” anymore, but this test is
> still passing despite that.  I think this particular test covers “sprout
> preserves kind if the to_bzrdir doesn't specify something else”... which is a
> start, but obviously leaves some important gaps :)
> I think perhaps we've been a little fuzzy on exactly what the design here is.
> Rather than assume I know what all the requirements and intentions are, I'll
> ask:
> What exactly is the behaviour of some_branch.sprout meant to be?
> -Andrew.

As you noticed, there was a change here, and I think Aaron might be the
best to mention what he is thinking.

I know we want a way to upgrade the format if someone explicitly
requests "--stacked" either via "bzr push --stacked" or "bzr branch
- --stacked".

We also want to be able to configure a BzrDir such that branches pushed
underneath it also default to the --stacked flag, but only if the branch
format supports it. So if you have a bzr config lying around it won't
silently upgrade your branch format, but if you are in 1.6+ format it
can auto-stack for you.

I'm not sure how else to_bzrdir could configure the format, but I think
it boils down to supporting 'bzr branch --stacked' auto-upgrading the
target format.

So I'm guessing it is actually 'sprout preserves to_bzrdir format, and
to_bzrdir should be initialized appropriately by the source format'.

Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list