[MERGE] Make bzr pack start optimising
John Arbash Meinel
john at arbash-meinel.com
Tue Dec 4 17:43:03 GMT 2007
John Arbash Meinel has voted tweak.
Status is now: Conditionally approved
Comment:
So, to summarize and make sure I understand the change correctly....
The bulk of the change is to change _copy_nodes_graph (and _do_copy...)
to not
figure out how to copy the nodes, but to have that passed in as a
readv_group_iter.
And then you created "_least_readv_node_readv()" to build up a group
iter that
minimizes the number of readvs you have to make, and had a
_sort_revisions()
function that uses _least_* in the case of auto-packing (and plain pull,
right?).
And gets subclassed for the Optmizing packer (which you also introduce).
I probably would prefer a different function name than
"_sort_revisions".
Maybe: _revision_node_readv, just to match the others.
- def _execute_pack_operations(self, pack_operations):
+ def _execute_pack_operations(self, pack_operations,
_packer_class=Packer):
"""Execute a series of pack operations.
:param pack_operations: A list of [revision_count,
packs_to_combine].
+ :param _packer_class: The class of packer to use. If not
supplied
+ Packer will be used.
:return: None.
"""
^- :param _packer_class: The class of packer to use (default: Packer).
So a small doc change, and a better name for _sort_revisions (maybe at
least
"sorted", since you are returning a sorted list...)
Otherwise, I'm happy to see this, and it is a good place to bring in
other pack
optimizations.
For details, see:
http://bundlebuggy.aaronbentley.com/request/%3C1196735765.15733.182.camel%40lifeless-64%3E
More information about the bazaar
mailing list