/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_fetch.py

  • Committer: Jelmer Vernooij
  • Date: 2018-06-21 17:53:38 UTC
  • mfrom: (6973.5.13 python3-c)
  • Revision ID: jelmer@jelmer.uk-20180621175338-v7loaib7mh7pfosf
Merge lp:~jelmer/brz/python3-c

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
                        source.inventories)
290
290
        # precondition
291
291
        self.assertTrue(target._format._fetch_uses_deltas)
292
 
        target.fetch(source, revision_id='rev-one')
 
292
        target.fetch(source, revision_id=b'rev-one')
293
293
        self.assertEqual(('get_record_stream', [('file-id', 'rev-one')],
294
294
                          target._format._fetch_order, False),
295
295
                         self.find_get_record_stream(source.texts.calls))
329
329
                        source.inventories)
330
330
        # XXX: This won't work in general, but for the dirstate format it does.
331
331
        self.overrideAttr(target._format, '_fetch_uses_deltas', False)
332
 
        target.fetch(source, revision_id='rev-one')
 
332
        target.fetch(source, revision_id=b'rev-one')
333
333
        self.assertEqual(('get_record_stream', [('file-id', 'rev-one')],
334
334
                          target._format._fetch_order, True),
335
335
                         self.find_get_record_stream(source.texts.calls))
373
373
        record = next(source.revisions.get_record_stream([('rev-two',)],
374
374
            'unordered', False))
375
375
        self.assertEqual('knit-delta-gz', record.storage_kind)
376
 
        target.fetch(tree.branch.repository, revision_id='rev-two')
 
376
        target.fetch(tree.branch.repository, revision_id=b'rev-two')
377
377
        # The record should get expanded back to a fulltext
378
378
        target.lock_read()
379
379
        self.addCleanup(target.unlock)
407
407
            fname = 'file%03d' % (i,)
408
408
            fileid = '%s-%s' % (fname, osutils.rand_chars(64))
409
409
            to_add.append(('add', (fname, fileid, 'file', 'content\n')))
410
 
        builder.build_snapshot(None, to_add, revision_id='A')
411
 
        builder.build_snapshot(['A'], [], revision_id='B')
412
 
        builder.build_snapshot(['A'], [], revision_id='C')
413
 
        builder.build_snapshot(['C'], [], revision_id='D')
414
 
        builder.build_snapshot(['D'], [], revision_id='E')
415
 
        builder.build_snapshot(['E', 'B'], [], revision_id='F')
 
410
        builder.build_snapshot(None, to_add, revision_id=b'A')
 
411
        builder.build_snapshot(['A'], [], revision_id=b'B')
 
412
        builder.build_snapshot(['A'], [], revision_id=b'C')
 
413
        builder.build_snapshot(['C'], [], revision_id=b'D')
 
414
        builder.build_snapshot(['D'], [], revision_id=b'E')
 
415
        builder.build_snapshot(['E', 'B'], [], revision_id=b'F')
416
416
        builder.finish_series()
417
417
        source_branch = builder.get_branch()
418
 
        source_branch.controldir.sprout('base', revision_id='B')
 
418
        source_branch.controldir.sprout('base', revision_id=b'B')
419
419
        target_branch = self.make_branch('target', format='1.6')
420
420
        target_branch.set_stacked_on_url('../base')
421
421
        source = source_branch.repository
437
437
        target_branch.lock_write()
438
438
        self.addCleanup(target_branch.unlock)
439
439
        target = target_branch.repository
440
 
        target.fetch(source, revision_id='F')
 
440
        target.fetch(source, revision_id=b'F')
441
441
        # 'C' should be expanded to a fulltext, but D and E should still be
442
442
        # deltas
443
443
        stream = target.inventories.get_record_stream(