[RFC] Getting nested tree repositories into use
Martin Pool
mbp at sourcefrog.net
Wed Jul 4 03:34:14 BST 2007
On 7/4/07, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> This problem exists because adding tree-references is automatic, rather
> than an explicit choice. I think making that explicit would be a
> simpler fix.
Robert's argument at the time was that tree references should be like
every other file kind - directly determined based on what we see on
disk at the time. This means not just that 'bzr add subdir' will
automatically add a reference, but that if you initially add an empty
directory and then replace it with a nested subtree it will
automatically turn into a reference.
The arguments for this (that I can remember) are:
- It's consistent with how we determine file kind in other cases -
doing this dynamically has been a win for cases like replacing files
with symlinks. But I think it's questionable whether people really
see nested trees as "just another file kind".
- For people who do want to use them, it will be pretty nice if 'bzr
add' just does the right thing.
- It avoids having to give errors if the kind changes from a
reference to something else. (But there will still be edge cases we
have to handle carefully.)
and against:
- It slows us down - (approximately) every time we examine a
directory in the working tree, we dig inside it to see if it's a
branch
- People might (???) want to have a versioned empty directory, with a
separately versioned tree inside it -- in other words to specifically
ignore the nested-tree features in some cases.
- We want to introduce them gradually to shake out bugs and make sure
we have them right, and to have them not active unless the user wants
them. So we need some kind of switch - if that's not done by
explicitly adding the reference, then we need to add an extra knob, or
key it off the repository type, both of which seem to proliferate
complexity.
- It means the behaviour of add and kind detection depend on the
branch or repository capabilities or configuration.
- If you want nested subtrees you probably need to know you want it,
and be prepared for their special behaviour. So it is not too much of
a burden to explicitly add them.
I'm not sure where we ultimately end up but I'm really averse to
adding a whole other configuration option to control this and I would
like to get them turned on. So if requiring an explicit add
--reference is a practical way to get them going, that would be ok
with me.
--
Martin
More information about the bazaar
mailing list