diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-02-18 15:18:23 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-02-18 15:18:23 +0100 |
commit | 8105a9b226040ec7a9dd509bf21ca922615c49b2 (patch) | |
tree | f8e6a59b70c2ce203f98323a30849b68c2b80f95 | |
parent | e5d8ce8831c45d50f7f778dde0753a48cb101c0b (diff) | |
download | bzr-fastimport-8105a9b226040ec7a9dd509bf21ca922615c49b2.tar.gz |
Fix compatibility with bzr 2.6.
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | tests/test_generic_processor.py | 18 |
2 files changed, 15 insertions, 9 deletions
@@ -6,6 +6,12 @@ bzr-fastimport Release Notes 0.13 UNRELEASED +Compatibility +------------- + +* Avoid using Tree.inventory directly, which is deprecated in bzr 2.6. + (Jelmer Vernooij) + 0.12 2012-02-09 Bug fixes diff --git a/tests/test_generic_processor.py b/tests/test_generic_processor.py index 1b4a809..6527ed0 100644 --- a/tests/test_generic_processor.py +++ b/tests/test_generic_processor.py @@ -171,26 +171,26 @@ class TestCaseForGenericProcessor(tests.TestCaseWithTransport): str(expected_kind_changed_entry), kind_changed_files)) def assertContent(self, branch, tree, path, content): - file_id = tree.inventory.path2id(path) + file_id = tree.path2id(path) branch.lock_read() self.addCleanup(branch.unlock) self.assertEqual(tree.get_file_text(file_id), content) def assertSymlinkTarget(self, branch, tree, path, target): - file_id = tree.inventory.path2id(path) + file_id = tree.path2id(path) branch.lock_read() self.addCleanup(branch.unlock) self.assertEqual(tree.get_symlink_target(file_id), target) def assertExecutable(self, branch, tree, path, executable): - file_id = tree.inventory.path2id(path) + file_id = tree.path2id(path) branch.lock_read() self.addCleanup(branch.unlock) self.assertEqual(tree.is_executable(file_id), executable) def assertRevisionRoot(self, revtree, path): self.assertEqual(revtree.get_revision_id(), - revtree.inventory.root.children[path].revision) + revtree.get_file_revision(revtree.path2id(path))) class TestImportToPackTag(TestCaseForGenericProcessor): @@ -1945,10 +1945,10 @@ class TestModifyRevertInBranch(TestCaseForGenericProcessor): rtree_a, rtree_b, rtree_c, rtree_d = branch.repository.revision_trees([ rev_a, rev_b, rev_c, rev_d]) foo_id = rtree_a.path2id('foo') - self.assertEqual(rev_a, rtree_a.inventory[foo_id].revision) - self.assertEqual(rev_b, rtree_b.inventory[foo_id].revision) - self.assertEqual(rev_c, rtree_c.inventory[foo_id].revision) - self.assertEqual(rev_c, rtree_d.inventory[foo_id].revision) + self.assertEqual(rev_a, rtree_a.get_file_revision(foo_id)) + self.assertEqual(rev_b, rtree_b.get_file_revision(foo_id)) + self.assertEqual(rev_c, rtree_c.get_file_revision(foo_id)) + self.assertEqual(rev_c, rtree_d.get_file_revision(foo_id)) class TestCommitCommands(TestCaseForGenericProcessor): @@ -1989,4 +1989,4 @@ class TestAddNonUtf8InBranch(TestCaseForGenericProcessor): rev_a = branch.last_revision() rtree_a = branch.repository.revision_tree(rev_a) foo_id = rtree_a.path2id(u'foo\ufffd') - self.assertEqual(rev_a, rtree_a.inventory[foo_id].revision) + self.assertEqual(rev_a, rtree_a.get_file_revision(foo_id)) |