[MERGE] StackableBranch

Aaron Bentley aaron at aaronbentley.com
Thu Jun 19 02:41:14 BST 2008


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

Ian Clatworthy wrote:
> Ian Clatworthy wrote:
>> Ian Clatworthy wrote:
>>> Here's an updated version which:
>>>
>>> * stores the stacked-on location in branch.conf
>>> * uses "stacked" instead of "shallow" in the API and UI.
>> As above but with target-branch set correctly now.
> 
> Apologies for the noise. Let's try again ...

bb:resubmit

I'm sorry I didn't notice this earlier, but this patch introduces
behavior that I fear may lead to disaster.  I'm not firm on this vote,
but it's my default position, until we've discussed it.

Specifically, it causes stacking to happen when the source branch is
stacked.  This will frequently not be what people want, and there is no
way to turn off the behavior.

Here's the code I'm talking about:

>      def sprout(self, url, revision_id=None, force_new_repo=False,
>                 recurse='down', possible_transports=None,
> -               accelerator_tree=None, hardlink=False):
> +               accelerator_tree=None, hardlink=False, stacked=False):
>          """Create a copy of this bzrdir prepared for use as a new line of
>          development.
>  
>          try:
>              source_branch = self.open_branch()
>              source_repository = source_branch.repository
> +            if stacked:
> +                stacked_branch_url = self.root_transport.base
> +            else:
> +                try:
> +                    stacked_branch_url = source_branch.get_stacked_on()
> +                except (errors.NotStacked, errors.UnstackableBranchFormat,
> +                    errors.UnstackableRepositoryFormat):
> +                    stacked_branch_url = None

So if the user requested stacking, we stack against the source branch.
That seems reasonable.  But if they didn't specify stacking, we stack
against whatever that branch was stacked on.  Even if they're branching
into a shared repo.

Sooner or later, someone is going to get stacking without realizing it,
 and they're going to get data loss when the stacked_on branch goes away.

While it is tempting to try to solve the slow-initial-branch problem, I
don't think this is the right way.

I think sprout shouldn't do stacking unless either:
- - the user requests it
- - there's a stacking policy on the target (and there should probably be
  an override to defeat that, also).

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIWbk50F+nu1YWqI0RAjqFAJ44XPfivB+ZVmSGGrFpmqimS1Bh+wCfbY5U
vcLKoyGjz4Fl1Qgyf3Dw1Dg=
=EPjh
-----END PGP SIGNATURE-----



More information about the bazaar mailing list