~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_interrepository/test_fetch.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.errors import (
28
28
    NoSuchRevision,
29
29
    )
30
 
from bzrlib.graph import (
 
30
from bzrlib.vf_search import (
31
31
    SearchResult,
32
32
    )
33
33
from bzrlib.revision import (
77
77
            self.addCleanup(tree.unlock)
78
78
            tree.get_file_text('file1')
79
79
            for file_id in tree.all_file_ids():
80
 
                if tree.inventory[file_id].kind == "file":
 
80
                if tree.kind(file_id) == "file":
81
81
                    tree.get_file(file_id).read()
82
82
 
83
83
        # makes a target version repo
179
179
    def test_fetch_parent_inventories_at_stacking_boundary_smart_old(self):
180
180
        self.setup_smart_server_with_call_log()
181
181
        self.disable_verb('Repository.insert_stream_1.19')
182
 
        self.test_fetch_parent_inventories_at_stacking_boundary()
 
182
        try:
 
183
            self.test_fetch_parent_inventories_at_stacking_boundary()
 
184
        except errors.ConnectionReset:
 
185
            self.knownFailure("Random spurious failure, see bug 874153")
183
186
 
184
187
    def test_fetch_parent_inventories_at_stacking_boundary(self):
185
188
        """Fetch to a stacked branch copies inventories for parents of
234
237
        (stacked_left_tree,
235
238
         stacked_right_tree) = stacked_branch.repository.revision_trees(
236
239
            ['left', 'right'])
237
 
        self.assertEqual(left_tree.inventory, stacked_left_tree.inventory)
238
 
        self.assertEqual(right_tree.inventory, stacked_right_tree.inventory)
 
240
        self.assertEqual(
 
241
            left_tree.root_inventory, stacked_left_tree.root_inventory)
 
242
        self.assertEqual(
 
243
            right_tree.root_inventory, stacked_right_tree.root_inventory)
239
244
 
240
245
        # Finally, it's not enough to see that the basis inventories are
241
246
        # present.  The texts introduced in merge (and only those) should be
296
301
        stacked_branch.lock_read()
297
302
        self.addCleanup(stacked_branch.unlock)
298
303
        stacked_second_tree = stacked_branch.repository.revision_tree('second')
299
 
        self.assertEqual(second_tree.inventory, stacked_second_tree.inventory)
 
304
        self.assertEqual(second_tree, stacked_second_tree)
300
305
        # Finally, it's not enough to see that the basis inventories are
301
306
        # present.  The texts introduced in merge (and only those) should be
302
307
        # present, and also generating a stream should succeed without blowing
380
385
        (stacked_left_tree,
381
386
         stacked_right_tree) = new_stacked_branch.repository.revision_trees(
382
387
            ['left', 'right'])
383
 
        self.assertEqual(left_tree.inventory, stacked_left_tree.inventory)
384
 
        self.assertEqual(right_tree.inventory, stacked_right_tree.inventory)
 
388
        self.assertEqual(left_tree, stacked_left_tree)
 
389
        self.assertEqual(right_tree, stacked_right_tree)
385
390
        # Finally, it's not enough to see that the basis inventories are
386
391
        # present.  The texts introduced in merge (and only those) should be
387
392
        # present, and also generating a stream should succeed without blowing