Accelerate build_tree by using working tree files

Aaron Bentley aaron.bentley at utoronto.ca
Fri Dec 21 15:01:30 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> It isn't good layering, it is just how we have it right now. (status
> *shouldn't* update the dirstate at the current location, as a side-effect of
> _iter_changes. It should have _iter_changes that can return "may_be_modified"
> and the higher level code can check and hand back "this is the new sha1".
>
> That way higher levels that may want the file text only have to read it 1 time
> (rather than reading to check the sha1, and then reading again to diff/commit
> the text to the repository).

In my view, these issues have very little overlap.

1. There ought to be an API for updating the SHA1 hashes in the wt.  I
suggest: WorkingTree.update_sha1s([(stat1, hash1), (stat2, hash2)])

I'd be interested in updating TreeTransform so that it can feed that
into WorkingTree at build/merge/pull/revert time.

2. Although there are cases where _iter_changes must calculate a sha1,
they are pretty rare.  So most of the time, iter_changes can be just as
efficient as your desired interface.  If _iter_changes is calculating
sha1s when the file has changed in size, please, for the love of God,
fix it.

The current _iter_changes API may not your ideal one, but half a loaf is
better than none.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHa9VK0F+nu1YWqI0RArhjAJ0Vq1exZ2U8Qd9+ukUZElgv88IBgACcDjg/
jPwiGZwp4/bR/x5hsvM5e1w=
=D6C4
-----END PGP SIGNATURE-----



More information about the bazaar mailing list