Playing with stacked branches

Aaron Bentley aaron at aaronbentley.com
Tue Apr 1 15:51:58 BST 2008


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

Hi all,

Stacked branches are important to Launchpad, because we don't have
infinite time or space, and shared repositories don't let us easily
toggle branches between being public or private.

So at Tim Penhey's suggestion, I've been playing around with them to
make sure I have a good idea where they're at.

I have some comments and questions,

Design
======
First, I thought we were going to use the term "stacked" rather than
"shallow", but the current docs and parameters use "shallow".

The current implementation requires that the stacked-on branch be in a
stacking-aware format.  Is that actually necessary?  Is it so that the
branch can specify whether it is willing to be stacked on?

With branch6, we moved to storing metadata in the branch.conf file,
rather than in single files on disk.  Stacked branches store the
"stacked-on" branch in a single file.  Is this a deliberate design
choice, or just a case of getting it done the fastest way?

The stacked-on URL is recorded as an absolute URL.  This means that it
specifies a particular protocol.  Wouldn't it be better, and more like a
shared repository, if the URL were relative to the stacked branch?  It
would also mean that the stacked and stacked-on branches could be moved
as a group, as long as their relative paths didn't change.

Stacked branches reintroduce a "branch-name".  Is this deliberate?

Implementation details
======================
It would be nice to have "checkout --shallow".  This is currently
achievable with "bzr branch --shallow; bzr bind", of course.

There should probably be a way (reconfigure?) to convert from stacked to
non-stacked.

Looms don't support stacked branches.  It would be nice if they did.

The smart transport does not handle unknown formats at all well:
$ bzr info bzr+ssh://aaronbentley.com/home/abentley/stacked
bzr: ERROR: Could not understand response from smart server: ('error',
"Unknown branch format: 'Bazaar Branch Format 7 (needs bzr 1.3)\\n'")

^^^ This should be a user error, and it should indicate that the remote
server does not understand the format.

The error when a stacked-on branch is missing is not very clear:
$ sbzr log bzr.ab2
bzr: ERROR: Not a branch: "/home/abentley/shallowtest/bzr.ab/".
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8kwO0F+nu1YWqI0RAv2zAKCJV0tMkyS3/IwPMJpFyzI0oMs//gCdF/tz
gP0h0GTESF/GV0FF/CJSLoQ=
=vRbE
-----END PGP SIGNATURE-----



More information about the bazaar mailing list