Rev 2331: Add tests for revision trees with a different unique root to the current tree. in file:///home/robertc/source/baz/dirstate/
Robert Collins
robertc at robertcollins.net
Fri Feb 16 06:10:17 GMT 2007
At file:///home/robertc/source/baz/dirstate/
------------------------------------------------------------
revno: 2331
revision-id: robertc at robertcollins.net-20070216061015-60p0vv623cigcg5x
parent: robertc at robertcollins.net-20070216060239-yvf7pfd94kv9vqy4
committer: Robert Collins <robertc at robertcollins.net>
branch nick: dirstate
timestamp: Fri 2007-02-16 17:10:15 +1100
message:
Add tests for revision trees with a different unique root to the current tree.
modified:
bzrlib/tests/workingtree_implementations/test_revision_tree.py test_revision_tree.p-20060908041847-n15ngjoxpivwls0v-2
=== modified file 'bzrlib/tests/workingtree_implementations/test_revision_tree.py'
--- a/bzrlib/tests/workingtree_implementations/test_revision_tree.py 2007-02-02 04:55:26 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_revision_tree.py 2007-02-16 06:10:15 +0000
@@ -69,3 +69,17 @@
tree = self.make_branch_and_tree('.')
tree.set_parent_ids(['a-ghost'], allow_leftmost_as_ghost=True)
self.assertRaises(errors.NoSuchRevision, tree.revision_tree, 'a-ghost')
+
+ def test_revision_tree_different_root_id(self):
+ """A revision tree might have a very different root."""
+ tree = self.make_branch_and_tree('tree1')
+ tree.set_root_id('one')
+ rev1 = tree.commit('first post')
+ tree.set_root_id('two')
+ try:
+ cached_revision_tree = tree.revision_tree(rev1)
+ except errors.NoSuchRevision:
+ # its ok for a working tree to not cache trees, so just return.
+ return
+ repository_revision_tree = tree.branch.repository.revision_tree(rev1)
+ self.assertTreesEqual(repository_revision_tree, cached_revision_tree)
More information about the bazaar-commits
mailing list