[RFC] Removing the inventory concept from Bazaar.

John Arbash Meinel john at arbash-meinel.com
Wed May 9 14:15:08 BST 2007


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

Daniel Silverstone wrote:
> On Tue, 2007-05-08 at 23:27 -0400, Aaron Bentley wrote:
>> So did you have any opinion of the alternatives I listed?
> 
> The content-lookup based on path is interesting. Assuming a lookup in a
> given level is constant time (which with hashing filesystems it pretty
> much is for the file-finding) then the act of finding a file becomes
> O(depth-of-file) which is an interesting option. You say Git works this
> way.
> 
> Does Mercurial do anything non-inventoryish? I'm fairly sure monotone
> maintains an inventory.
> 
> D.
> 

Mercurial uses a "Manifest" which is something like:

path/to/foo sha_hash_of_foo
...

Which is essentially an inventory.

And they store their files as:

.hg/path/to/foo.i


The big killer for all of these designs is handling renames, though.
Because now, even though it is at "path/to/foo" in *this* revision, in
an old revision it might have been at "alt/path/bar"

Now, I believe they have a place in their index for "this was copied
from X".

So when they do a lookup for "path/foo", and they want to compare it to
an old revision, they can jump to .hg/path/foo.i, and probably read that
index, looking for the old revision.

They may also look through that index to see if there are any "copied
from" sections, and look over there to see if anything has changed.

I'm not sure about how they handle renames, though, because they didn't
until 0.9.3 (their latest release).

I would guess they have some edge cases that they don't handle (or even
choose not to).

For example:

  bzr add a b
  bzr commit -m 1
  bzr rm a
  bzr mv b a
  bzr commit -m 2
  bzr diff -r 1 a

So should that compare the current file 'a' with the file 'a' that was
in revision 1, or should it compare it with file 'b' which was renamed
to 'a'.

We believe that it should diff against 'b'. A lot of other systems don't.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQclcJdeBCYSNAAMRAlVQAKDCX71A5gKmfD78ZU0q0uvkfWwiawCeNzTO
gAzTefbBqVn7p4/KCkcwzaQ=
=uG/N
-----END PGP SIGNATURE-----



More information about the bazaar mailing list