RFC: install_revisions -> install_deltas ?

Martin Pool mbp at canonical.com
Wed Oct 15 03:43:41 BST 2008


On Wed, Oct 15, 2008 at 12:08 PM, Robert Collins
<robertc at robertcollins.net> wrote:
> Putting aside the desire I have to consolidate with CommitBuilder,
> because CommitBuilder is (today) still full-tree always as well, I'm
> wondering about a new API on Repository:
>
> def install_revision_deltas(self, deltas):
>    """Install a number of revision deltas into this repository.
>
>    Each delta is fetched incrementally; if the basis revision is not
>    present then the tree object is used directly to obtain the content
>    of the new revision being inserted.
>
>    :param deltas: An iterable of (new_revision_object, new_tree_object,
>        revision_signature_or_None, basis_revision_id,
>        inventory_delta_against_basis) tuples.
>    :return: None
>    """
>
> I think this would be substantially faster for repositories which are
> able to work in less than full-tree terms; xml inventory repositories
> wouldn't benefit a lot (and would probably just delegate to
> install_revisions), but a CHK based repository, or things like bzr-git
> and bzr-svn would likely benefit a lot.

This sounds reasonable to me.  I think this can be done without
reworking commit at the time, but I would be at least tempted to look
whether everything within commit could in principle be rewritten onto
this interface.

>    Each delta is fetched incrementally; if the basis revision is not
>    present then the tree object is used directly to obtain the content
>    of the new revision being inserted.
>

However, if the basis revision is present in the destination object
then the delta must be supplied?  Is it OK to eg pass None as the
basis_revision_id and no delta?

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list