~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Martin
  • Date: 2011-04-15 21:22:57 UTC
  • mto: This revision was merged to the branch mainline in revision 5797.
  • Revision ID: gzlist@googlemail.com-20110415212257-jgtovwwp4be7egd9
Add release notes

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    osutils,
31
31
    pack,
32
32
    ui,
33
 
    versionedfile,
34
33
    )
35
34
from bzrlib.bzrdir import BzrDir
36
35
from bzrlib.smart.request import (
39
38
    SuccessfulSmartServerResponse,
40
39
    )
41
40
from bzrlib.repository import _strip_NULL_ghosts, network_format_registry
42
 
from bzrlib.recordcounter import RecordCounter
43
41
from bzrlib import revision as _mod_revision
44
42
from bzrlib.versionedfile import (
45
43
    NetworkRecordStream,
83
81
            recreate_search trusts that clients will look for missing things
84
82
            they expected and get it from elsewhere.
85
83
        """
 
84
        if search_bytes == 'everything':
 
85
            return graph.EverythingResult(repository), None
86
86
        lines = search_bytes.split('\n')
87
87
        if lines[0] == 'ancestry-of':
88
88
            heads = lines[1:]
414
414
    def do_repository_request(self, repository, to_network_name):
415
415
        """Get a stream for inserting into a to_format repository.
416
416
 
 
417
        The request body is 'search_bytes', a description of the revisions
 
418
        being requested.
 
419
 
 
420
        In 2.3 this verb added support for search_bytes == 'everything'.  Older
 
421
        implementations will respond with a BadSearch error, and clients should
 
422
        catch this and fallback appropriately.
 
423
 
417
424
        :param repository: The repository to stream from.
418
425
        :param to_network_name: The network name of the format of the target
419
426
            repository.
491
498
 
492
499
 
493
500
class SmartServerRepositoryGetStream_1_19(SmartServerRepositoryGetStream):
 
501
    """The same as Repository.get_stream, but will return stream CHK formats to
 
502
    clients.
 
503
 
 
504
    See SmartServerRepositoryGetStream._should_fake_unknown.
 
505
    
 
506
    New in 1.19.
 
507
    """
494
508
 
495
509
    def _should_fake_unknown(self):
496
510
        """Returns False; we don't need to workaround bugs in 1.19+ clients."""
506
520
        for record in substream:
507
521
            if record.storage_kind in ('chunked', 'fulltext'):
508
522
                serialised = record_to_fulltext_bytes(record)
509
 
            elif record.storage_kind == 'inventory-delta':
510
 
                serialised = record_to_inventory_delta_bytes(record)
511
523
            elif record.storage_kind == 'absent':
512
524
                raise ValueError("Absent factory for %s" % (record.key,))
513
525
            else: