Rev 3586: Add directions to use BranchBuilder for tests. in

John Arbash Meinel john at
Tue Jul 29 17:28:59 BST 2008


revno: 3586
revision-id: john at
parent: john at
committer: John Arbash Meinel <john at>
branch nick: branch_builder
timestamp: Tue 2008-07-29 11:28:37 -0500
  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/`` for how to use the

More information about the bazaar-commits mailing list