~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fetch.py

  • Committer: Robert Collins
  • Date: 2009-02-27 01:02:40 UTC
  • mto: This revision was merged to the branch mainline in revision 4060.
  • Revision ID: robertc@robertcollins.net-20090227010240-35dzaxn8bah0razi
Move the fetch control attributes from Repository to RepositoryFormat.

Show diffs side-by-side

added added

removed removed

Lines of Context:
367
367
        source.inventories = versionedfile.RecordingVersionedFilesDecorator(
368
368
                        source.inventories)
369
369
        # precondition
370
 
        self.assertTrue(target._fetch_uses_deltas)
 
370
        self.assertTrue(target._format._fetch_uses_deltas)
371
371
        target.fetch(source, revision_id='rev-one')
372
372
        self.assertEqual(('get_record_stream', [('file-id', 'rev-one')],
373
 
                          target._fetch_order, False),
 
373
                          target._format._fetch_order, False),
374
374
                         self.find_get_record_stream(source.texts.calls))
375
375
        self.assertEqual(('get_record_stream', [('rev-one',)],
376
 
                          target._fetch_order, False),
 
376
                          target._format._fetch_order, False),
377
377
                         self.find_get_record_stream(source.inventories.calls))
378
378
        self.assertEqual(('get_record_stream', [('rev-one',)],
379
 
                          target._fetch_order, False),
 
379
                          target._format._fetch_order, False),
380
380
                         self.find_get_record_stream(source.revisions.calls))
381
381
        # XXX: Signatures is special, and slightly broken. The
382
382
        # standard item_keys_introduced_by actually does a lookup for every
387
387
        # we care about.
388
388
        signature_calls = source.signatures.calls[-1:]
389
389
        self.assertEqual(('get_record_stream', [('rev-one',)],
390
 
                          target._fetch_order, False),
 
390
                          target._format._fetch_order, False),
391
391
                         self.find_get_record_stream(signature_calls))
392
392
 
393
393
    def test_fetch_no_deltas_with_delta_closure(self):
406
406
                        source.revisions)
407
407
        source.inventories = versionedfile.RecordingVersionedFilesDecorator(
408
408
                        source.inventories)
409
 
        target._fetch_uses_deltas = False
 
409
        # XXX: This won't work in general, but for the dirstate format it does.
 
410
        old_fetch_uses_deltas_setting = target._format._fetch_uses_deltas
 
411
        def restore():
 
412
            target._format._fetch_uses_deltas = old_fetch_uses_deltas_setting
 
413
        self.addCleanup(restore)
 
414
        target._format._fetch_uses_deltas = False
410
415
        target.fetch(source, revision_id='rev-one')
411
416
        self.assertEqual(('get_record_stream', [('file-id', 'rev-one')],
412
 
                          target._fetch_order, True),
 
417
                          target._format._fetch_order, True),
413
418
                         self.find_get_record_stream(source.texts.calls))
414
419
        self.assertEqual(('get_record_stream', [('rev-one',)],
415
 
                          target._fetch_order, True),
 
420
                          target._format._fetch_order, True),
416
421
                         self.find_get_record_stream(source.inventories.calls))
417
422
        self.assertEqual(('get_record_stream', [('rev-one',)],
418
 
                          target._fetch_order, True),
 
423
                          target._format._fetch_order, True),
419
424
                         self.find_get_record_stream(source.revisions.calls))
420
425
        # XXX: Signatures is special, and slightly broken. The
421
426
        # standard item_keys_introduced_by actually does a lookup for every
426
431
        # we care about.
427
432
        signature_calls = source.signatures.calls[-1:]
428
433
        self.assertEqual(('get_record_stream', [('rev-one',)],
429
 
                          target._fetch_order, True),
 
434
                          target._format._fetch_order, True),
430
435
                         self.find_get_record_stream(signature_calls))
431
436
 
432
437
    def test_fetch_revisions_with_deltas_into_pack(self):