summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-02-18 15:18:23 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-02-18 15:18:23 +0100
commit8105a9b226040ec7a9dd509bf21ca922615c49b2 (patch)
treef8e6a59b70c2ce203f98323a30849b68c2b80f95
parente5d8ce8831c45d50f7f778dde0753a48cb101c0b (diff)
downloadbzr-fastimport-8105a9b226040ec7a9dd509bf21ca922615c49b2.tar.gz
Fix compatibility with bzr 2.6.
-rw-r--r--NEWS6
-rw-r--r--tests/test_generic_processor.py18
2 files changed, 15 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index f8412e3..3387c53 100644
--- a/NEWS
+++ b/NEWS
@@ -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))