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

Jelmer Vernooij jelmer at samba.org
Thu Dec 21 15:30:58 GMT 2006


On Thu, 2006-12-21 at 09:29 -0500, Aaron Bentley wrote:
> Jelmer Vernooij wrote:
> > Thoughts?
> Could you explain why the bzr-svn generates new file ids at commit time?
>  Why doesn't it do that when you import a branch from bzr?
Well, that's when it usually generates file ids. But if you have
checkout out a Subversion branch using Bazaar, then add a file locally
and commit it, Bazaar will have locally generated file id:

$ bzr checkout svn+ssh://svn.samba.org/smb-build/trunk smb-build
$ cd smb-build 
$ echo "foo" > bar
$ bzr add bar
$ bzr inventory --show-ids | grep foo
foo                         foo--20061221151143-50yaxntdektqvtue-1
$ bzr commit
^^ bzr-svn will assign a different file-id to "foo",
but .bzr/checkout/inventory will still have file-id
foo--20061221151143-50yaxntdektqvtue-1 for foo.

> > What sort of CommitBuilder API would people like to see?
> 
> I think it should be:
> 
> CommitBuilder.set_working_tree(wt)
^^ wt would be any Tree, not necessarily a WorkingTree ? I think it
should be possible to do a commit without a working tree.

> CommitBuilder.set_basis_tree(wt.basis())
> for change in wt.logical_compare_to_parents()
>     CommitBuilder.record_change(change)
> commit()
And a sideeffect of record_change() could be that the file id of one
entries in CommitBuilder.working_tree would change?

Cheers,

Jelmer

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





More information about the bazaar mailing list