[MERGE] Delegate basis inventory calculation during commit to the CommitBuilder object.

John Arbash Meinel john at arbash-meinel.com
Sun Dec 7 17:30:33 GMT 2008


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

John Arbash Meinel wrote:
> This is a follow up on Robert's patch, which I believe addresses
> Martin's concerns.
> 
> 1) Rename the Repository function to "add_inventory_by_delta()". I
> believe we all agree it is a better name.
> 
> 2) Change the function to "CommitBuilder.will_record_deletes()". We need
> to have some way for the code that *uses* CommitBuilder to inform CB
> that it promises to call record_delete() so that the inventory delta
> being computed will be valid.
> 
> We could pass it as a constructor, but that actually requires passing it
> through Repository.get_commit_builder() which is a more invasive API break.
> 
> I chose "will_record_deletes()" to help push harder on the fact that it
> is the clients responsibility to call record_delete() and not a signal
> to the CommitBuilder that *it* should record deletes.
> 
> 3) Changed away from using the list directly (cb.basis_delta) to having
> a function cb.get_basis_delta() which refuses to work if the client has
> not already informed the CB that it promised to call record_delete().
> 
> I'm pushing to see this merged, because I want to bring in some more of
> the chk code into bzr core (partially because I have some bug fixes for
> them, and I think getting it as core code is a better way of getting it
> under test).
> 
> John
> =:->
> 

This is a minor update. I was merging the change back into the
brisbane-core branch, and realized that Jelmer had wanted to get the new
Inventory object back. So this update changes "add_inventory_by_delta()"
so that it returns both the validator and the Inventory object.

It seems reasonable to return it since we probably have to compute it if
we have it.

I would be okay with allowing it to be None and having the clients be
required to handle it, though all of our current implementations will
have something to return, so that could be YAGNI.

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

iEYEARECAAYFAkk8CDkACgkQJdeBCYSNAAPnxgCfYH9DOzNw+TbygvTdKOZMElGT
LZkAn2K8mEH2SF2F9n3iwGnLc+4rkW02
=Fy0q
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: add_inventory_by_delta.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20081207/3546b846/attachment-0001.diff 


More information about the bazaar mailing list