Rev 3586: Add directions to use BranchBuilder for tests. in http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/branch_builder
John Arbash Meinel
john at arbash-meinel.com
Tue Jul 29 17:28:59 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/branch_builder
------------------------------------------------------------
revno: 3586
revision-id: john at arbash-meinel.com-20080729162837-4bcjhmvi405qp25h
parent: john at arbash-meinel.com-20080729161636-aekx4mzqqf4733wl
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: branch_builder
timestamp: Tue 2008-07-29 11:28:37 -0500
message:
Add directions to use BranchBuilder for tests.
-------------- next part --------------
=== modified file 'doc/developers/HACKING.txt'
--- a/doc/developers/HACKING.txt 2008-07-15 05:06:13 +0000
+++ b/doc/developers/HACKING.txt 2008-07-29 16:28:37 +0000
@@ -406,6 +406,17 @@
subprocess you can use ``run_bzr_subprocess``. By default the spawned
process will not load plugins unless ``--allow-plugins`` is supplied.
+When writing library functionality, it is often necessary to set up a
+branch with a certain history. Most current tests do this by inheriting
+from ``TestCaseWithTransport`` and using the ``make_branch_and_tree``
+helper to give them a ``WorkingTree`` that they can commit to. However,
+there is a newer api available from ``TestCaseWithMemoryTransport`` using
+the ``make_branch_builder`` helper. This helper is preferred, because it
+can build the changes in memory, rather than on disk. Tests that are
+explictly testing how we work with disk objects should, of course, use a
+real ``WorkingTree``. See ``bzrlib/branch_builder.py`` for how to use the
+class.
+
Doctests
--------
More information about the bazaar-commits
mailing list