[RFC] Inventory.__delitem__ considered harmful
aaron.bentley at utoronto.ca
Fri Sep 8 01:02:37 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Robert Collins wrote:
> I've had a look, and I'm entirely sure I get the code - but if I do,
> then limbo_inv is an inventory that is parallel to the working one.
> So, it looks to me like because you are going child to parent:
> - you can use remove_recursive_id rather than del.
Yes. I read the "__delitem__ considered harmful" message before I read
the "merge WT.unversion" message, so I didn't see that you were planning
to supply an alternative.
> - when you move items to limbo, your limbo inventory has its invariants
> broken, but the working one is consistent the whole time.
Yes. In fact, the limbo inventory isn't even an inventory, just a dict.
> I wonder if giving Inventory the ability to manage limbo for you would
> be appropriate? That is, reserve a directory called '.bzr-limbo' with
> file-id '.bzr-limbo' in every inventory for the tree-transform code. You
> can use this with real trees to store disk resources that are in limbo,
> and with inventories to stash inventory entries. We'd update
> parent-child pointers etc as they are moved in-and-out of there.
I'm a bit hesitant about using a magic filename for that purpose. The
idea of having WorkingTree manage limbo is interesting, though.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v184.108.40.206 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar