What's the deal with MemoryTree?

Aaron Bentley aaron at aaronbentley.com
Tue Aug 25 00:59:16 BST 2009


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

Justyn Butler wrote:
> 2009/8/19 Aaron Bentley <aaron at aaronbentley.com>:
>> Justyn Butler wrote:

>> ...you can already merge and generate a PreviewTree, or just commit the
>> TransformPreview directly.

> I have now looked into TransformPreviews and PreviewTrees but after a
> great deal of trying cannot persuade a PreviewTree committed using a
> CommitBuilder to associate with a branch.
> 
> I have been looking mainly at test_commit_preview_tree in
> test_transform.py (bzrlib 1.17).

In bzr 1.18rc1 and later, TransformPreview has a commit method.

> test_commit_preview_tree finishes by getting a revision tree from the
> repository using the revision id it gained from CommitBuilder.commit.
> It checks the contents of a file in this revision tree.
> 
> But the revision tree is not associated with the branch. Querying the
> branch will throw a NoSuchRevision error. The revision exists in the
> repository only. Setting the branch-nick revprop when generating the
> commit builder doesn't help.

Yes, that code lacks the final step: calling Branch.set_last_revision_info()

I recommend using bzr 1.8rc1 or later and calling
TransformPreview.commit, but if you can't, it at least serves as an
example of how to do it.

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

iEYEARECAAYFAkqTKVAACgkQ0F+nu1YWqI3nAACfe7j/ixRX3If7mlWzWpvlxlpX
jnYAnRxp+Pms/QjJVs5soNJVxjhdY7t3
=q2qA
-----END PGP SIGNATURE-----



More information about the bazaar mailing list