[RFC] strawman explict object-tracking API

Aaron Bentley aaron.bentley at utoronto.ca
Tue Apr 17 14:52:09 BST 2007


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

Robert Collins wrote:
> We could put a list of registered objects into each domain - e.g. have
> 'bzrlib.transport._open_transports', but I think this is pure ugly: Its
> not discoverable to users of the api, its not good for threaded apps
> like servers, it makes testing complex.

On the other hand, it may force clients to cart around a bunch of extra
"cache" objects.

For the bzr client, I can't really imagine circumstances where I'd say
"Open a branch, and don't reuse any existing objects, please".  In
selftest, sure, but not in normal commands.

I think I like Ian's suggestion of a context object better, but more, I
would like Branch.open_containing() to DTRT without me having to
intervene.  I think wanting to avoid the cache is a lot less common than
wanting the cache, and we should optimize the API for the our common use
cases.

I also worry about testing.  Detecting misuse of your suggested API will
require careful testing.  Most commands are not tested by running them
with the same branch repeated (e.g. "bzr merge .").  But if we don't
make reuse the default, then we will probably get a lot of commands that
don't reuse objects, even when they should.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJNEJ0F+nu1YWqI0RAmh+AJ46Z6Yj04YKmXvvlgQJcvdHimu59gCfYDvv
qpCaqXgmxuYPJT47SPhDQE0=
=V4mi
-----END PGP SIGNATURE-----



More information about the bazaar mailing list