[RFC] Commit Builder restructuring (Re: [RFC] letting the commit builder assign the file ids)

Jelmer Vernooij jelmer at samba.org
Thu Dec 21 14:05:23 GMT 2006

On Thu, 2006-12-21 at 15:12 +1100, Martin Pool wrote: 
> On 21 Dec 2006, Jelmer Vernooij <jelmer at samba.org> wrote:
> > The CommitBuilder can currently assign the revision id when a commit is
> > made. This is useful for foreign branches, as the foreign branch
> > implementation can then determine the revision id. 
> > [...]
> > Thoughts?
> I think it would be ok for the commit builder to have read/write access
> to the working inventory and to change the file ids during the commit.
> I expect it only wants to do that for files newly added and
> first committed to svn.
At the moment, however, the commit builder doesn't actually receive the
new inventory - it only gets called for each file that has changed. I
remember reading about other changes people were looking to make to the
commit builder (delta-based, etc?). Maybe this is a good moment to make
those changes as well.

At the moment, the commit builder works roughly as follows:

* commit builders gets initialized and receives handles to the
repository, branch and old inventory

* record_inventory_entry() gets called for each inventory entry in the
new tree if the entry was selected or the entry in the old tree if the
entry wasn't selected

* modified_{file,link,directory} gets called for each modified entry
that was selected

* commit() gets called and records all changes

That means that the commit builder actually rebuilds the new inventory.
After that new inventory is committed, however, it's discarded. 

The problem is that if the commit is partial, it's not a matter of
simply overwriting the existing inventory in the working tree as that
might overwrite changes that weren't selected for the commmit. We'd have
to somehow merge the inventory of the commit and the inventory of the
working tree. 

Thoughts? What sort of CommitBuilder API would people like to see?


Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/

More information about the bazaar mailing list