~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-21 10:48:23 UTC
  • mfrom: (5393.6.3 bzr)
  • Revision ID: pqm@pqm.ubuntu.com-20100921104823-0jks3g5o1bahesyq
(spiv) Fix traceback with python 2.7's xmlrpclib. (Toshio Kuratomi)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    osutils,
31
31
    pack,
32
32
    ui,
 
33
    versionedfile,
33
34
    )
34
35
from bzrlib.bzrdir import BzrDir
35
36
from bzrlib.smart.request import (
38
39
    SuccessfulSmartServerResponse,
39
40
    )
40
41
from bzrlib.repository import _strip_NULL_ghosts, network_format_registry
 
42
from bzrlib.recordcounter import RecordCounter
41
43
from bzrlib import revision as _mod_revision
42
44
from bzrlib.versionedfile import (
43
45
    NetworkRecordStream,
81
83
            recreate_search trusts that clients will look for missing things
82
84
            they expected and get it from elsewhere.
83
85
        """
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
 
 
424
417
        :param repository: The repository to stream from.
425
418
        :param to_network_name: The network name of the format of the target
426
419
            repository.
498
491
 
499
492
 
500
493
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
 
    """
508
494
 
509
495
    def _should_fake_unknown(self):
510
496
        """Returns False; we don't need to workaround bugs in 1.19+ clients."""
520
506
        for record in substream:
521
507
            if record.storage_kind in ('chunked', 'fulltext'):
522
508
                serialised = record_to_fulltext_bytes(record)
 
509
            elif record.storage_kind == 'inventory-delta':
 
510
                serialised = record_to_inventory_delta_bytes(record)
523
511
            elif record.storage_kind == 'absent':
524
512
                raise ValueError("Absent factory for %s" % (record.key,))
525
513
            else: