/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_bundle.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-08-07 20:37:53 UTC
  • mfrom: (7058.3.13 random)
  • Revision ID: breezy.the.bot@gmail.com-20180807203753-nl79574d8e7hmqfo
Fix a couple of flappy tests.

Merged from https://code.launchpad.net/~jelmer/brz/random/+merge/352328

Show diffs side-by-side

added added

removed removed

Lines of Context:
1173
1173
        # rev2 is present in bundle, and done by fetch
1174
1174
        # having file1 in the bunle causes file1's versionedfile to be opened.
1175
1175
        self.tree1.add('file3', b'file3-id')
1176
 
        self.tree1.commit('rev2')
 
1176
        rev2 = self.tree1.commit('rev2')
1177
1177
        # Updating file2 should not cause an attempt to add to file1's vf
1178
1178
        target = self.tree1.controldir.sprout('target').open_workingtree()
1179
1179
        self.build_tree_contents([('tree/file2', b'contents3')])
1181
1181
        bundle = self.get_valid_bundle(b'reva', b'rev3')
1182
1182
        if getattr(bundle, 'get_bundle_reader', None) is None:
1183
1183
            raise tests.TestSkipped('Bundle format cannot provide reader')
1184
 
        # be sure that file1 comes before file2
1185
 
        for b, m, k, r, f in bundle.get_bundle_reader().iter_records():
1186
 
            if f == b'file3-id':
1187
 
                break
1188
 
            self.assertNotEqual(f, b'file2-id')
 
1184
        file_ids = set(
 
1185
            (f, r) for b, m, k, r, f in bundle.get_bundle_reader().iter_records()
 
1186
            if f is not None)
 
1187
        self.assertEqual({(b'file2-id', b'rev3'), (b'file3-id', rev2)}, file_ids)
1189
1188
        bundle.install_revisions(target.branch.repository)
1190
1189
 
1191
1190