[MERGE] Reduce overhead on commit by using knit specific API

Robert Collins robertc at robertcollins.net
Tue Sep 11 01:13:48 BST 2007


On Mon, 2007-09-10 at 22:26 +1000, Ian Clatworthy wrote:
> Robert Collins wrote:
> 
> bb: tweak
> 
> > The check in question is only performed during 'add_lines', not
> > add_lines_with_ghosts, so I addressed this by changing CommitBuilder to
> > use add_lines_with_ghosts, using a subclass of that to preserve the api
> > used by weave repositories when adding texts.
> 
> Hmm. If we're calling add_lines_with_ghosts() instead of add_lines() in
> order to skip a check, then I think we need a better method name or
> another method name: add_lines_no_parent_check() say.

Uhm, add_lines_with_ghosts is an existing method whose contract is less
strict - because using it implies more capabilities in the
implementation. with_ghosts was the name given because it supports
adding with some or all parents as ghosts, no_parent_check doesn't imply
that the add *will work* if parents are missing. I think the name is
maybe improvable but better than your suggestion.

> > At the same time I noted that we have a trivial compatibility hunk in
> > place in CommitBuilder which only affects subclasses of CommitBuilder
> > that require that the root entry *not* be supplied. The only plugins can
> > can be affected by this are foreign repository suppliers - bzr-svn,
> > bzr-hg etc - which also support commits, and AFAIK that means only
> > bzr-svn which subclasses RootCommitBuilder and is unaffected. So I
> > cleaned up the compatibility layer too to help keep the code simpler.
> 
> The code looks fine. I can't comment on whether changing
> RootCommitBuilder semantics like this is acceptable or not. Please be
> sure to get sign off from Jelmer and Aaron (say) before merging.

There are no changes to RootCommitBuilder, only to CommitBuilder, so it
won't affect bzr-svn at all.

Cheers,
Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070911/54cbdec4/attachment.pgp 


More information about the bazaar mailing list