Rev 5878: Clean up test_inv. in http://bazaar.launchpad.net/~jameinel/bzr/2.4-set-parent-trees-delta-282941
John Arbash Meinel
john at arbash-meinel.com
Thu May 19 13:14:27 UTC 2011
At http://bazaar.launchpad.net/~jameinel/bzr/2.4-set-parent-trees-delta-282941
------------------------------------------------------------
revno: 5878
revision-id: john at arbash-meinel.com-20110519131417-zm5dp7gvtcjujk9y
parent: john at arbash-meinel.com-20110519130510-taqse4n3sxzxjyj8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-set-parent-trees-delta-282941
timestamp: Thu 2011-05-19 15:14:17 +0200
message:
Clean up test_inv.
The tests were failing for WT2/3 anyway. But instead of shotgunning slow tests
in test_inv, do fast directed tests in test_dirstate.
We might actually be in the clear, though I'd like to improve performance by
using update_changed more often, and we may want a direct test of root-id
changing?
-------------- next part --------------
=== modified file 'bzrlib/tests/test_inv.py'
--- a/bzrlib/tests/test_inv.py 2011-05-19 11:19:42 +0000
+++ b/bzrlib/tests/test_inv.py 2011-05-19 13:14:17 +0000
@@ -204,47 +204,6 @@
try:
target_entries = _create_repo_revisions(tree.branch.repository, basis,
delta, expect_fail)
- # For successful deltas, we try different permutations
- # 1) active WT has no state
- # 2) active WT has all entries in target, but all at a different
- # location
- # 3) active WT is at target, basis tree is updated from basis to target
- # 4) active WT is at basis, basis tree is updated to new target
- # TODO: active WT has all paths as target, but different file_ids.
- # For expect_fail = True, we only do the last one.
- if not expect_fail:
- tree1 = tree.bzrdir.sprout('tree1').open_workingtree()
- tree1.branch.repository.fetch(tree.branch.repository)
- tree1.set_parent_ids(['basis'])
- tree1.lock_write()
- try:
- tree1.update_basis_by_delta('result', delta)
- tree1._validate()
- finally:
- tree1.unlock()
- tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
- tree2.branch.repository.fetch(tree.branch.repository)
- tree2.lock_write()
- try:
- _populate_different_tree(tree2, basis, delta)
- tree2.set_parent_ids(['basis'])
- tree2.update_basis_by_delta('result', delta)
- tree2._validate()
- finally:
- tree2.unlock()
- test.assertEqual(target_entries, _get_basis_entries(tree1))
- tree3 = tree.bzrdir.sprout('tree3').open_workingtree()
- tree3.branch.repository.fetch(tree.branch.repository)
- tree3.lock_write()
- try:
- tree3._write_inventory(basis)
- tree3.set_parent_ids(['basis'])
- tree3.apply_inventory_delta(delta)
- tree3.update_basis_by_delta('result', delta)
- tree3._validate()
- finally:
- tree3.unlock()
- test.assertEqual(target_entries, _get_basis_entries(tree3))
# Set the basis state as the trees current state
tree._write_inventory(basis)
# This reads basis from the repo and puts it into the tree's local
More information about the bazaar-commits
mailing list