ROOT gets a file_id

John A Meinel john at arbash-meinel.com
Thu Jun 16 16:58:40 BST 2005


One thing that was missing with tla & baz is to have the root of the
filesystem include a inventory id (file_id). The specific use case for
it was that it allows you to break a project up into sub-projects (in
arch you can use configs to keep it together). And then merging back
with the all-in-one project still works for changes. Without a root id,
though, new additions generally get added in the wrong directory.

Here is a specific example:

Original project:

$wd/			<= file_id = ROOT
  .bzr/
  lib1/           	<= lib1-abcd
    foo1.c		<= foo1-abcd
  lib2/			<= lib2-efgh
    foo2.c		<= foo2-efgh
  meta-info.c		<= meta-info-ijkl

Split up into multiple projects:
$wd/			<= file_id = ROOT
  .bzr/
  lib1/           	<= ROOT
    .bzr/
    foo1.c		<= foo1-abcd
  lib2/			<= ROOT
    .bzr/
    foo2.c		<= foo2-efgh
  meta-info.c		<= meta-info-ijkl

If I make a change to foo1.c and then merge it back into the original
project, it should work fine, since the foo1.c inventory ids are the same.

However, notice that in the multiple-project format, I lost the fact
that lib1 had the inventory id of lib1-abcd. So if I add a new file as
"lib1/foo3.c" it will have a parent of ROOT, rather than a parent of
"lib1-abcd".
Which means that if I merge that change back into the original project,
the file will show up as "$wd/foo3.c".

Now, in arch I broke up projects because it didn't scale very well to
large trees, especially on windows. (It could easily take > 30s just to
do a "tla changes", not to mention the time it took for a "tla commit").

It is possible that bzr will fix all of this, and we will never need to
break up a project tree. Though I doubt that, as another project I work
on has about 90 different sub-projects. Mostly because we wanted to
separately version each library/plugin.

Anyway, my proposal would be to do the following, add an inventory id to
the root of the working directory, the inventory XML would look
something like this:

<inventory root_file_id="root-12345678">
<entry file_id="meta-info.c-123455555" kind="file" parent="root-12345678" />
</inventory>

Rather than the current method, where entries in "root" do not have a
parent. (though internally they point to an artificial ROOT variable).

The alternative would be to have something like:
<inventory>
<entry file_id="root-12345678" kind="root" />
</inventory>

Or you could have the root entry have kind "directory" and not have a
parent, but all others would have to have a parent.

I think I like putting the root_id into the inventory tag the most,
because it is generally compatible with the current situation. You could
say that if an entry doesn't have a parent, then it implicitly has the
parent of the root_id present in the inventory.

The only problem would be you would need to explicitly generate a unique
id for root on projects that already exist, and then update all of the
inventories to use this. But that could be done with some sort of
"upgrade" command. Already we have "bzr check --upgrade", we could
probably tie into that one. Though I know you didn't prefer that.

Is this not a use case that you care to support, or should I pursue this
further?

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050616/3ba47925/attachment.pgp 


More information about the bazaar mailing list