/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 bzrlib/remote.py

  • Committer: Andrew Bennetts
  • Date: 2009-03-05 12:48:48 UTC
  • mto: (4086.1.2 hpss-integration)
  • mto: This revision was merged to the branch mainline in revision 4087.
  • Revision ID: andrew.bennetts@canonical.com-20090305124848-j7bsh3mxwpgevbbw
Better wire protocol: don't shoehorn MiniSearchResult serialisation into previous serialisation format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1423
1423
        count = str(recipe[2])
1424
1424
        return '\n'.join((start_keys, stop_keys, count))
1425
1425
 
 
1426
    def _serialise_search_result(self, search_result):
 
1427
        if isinstance(search_result, graph.MiniSearchResult):
 
1428
            parts = ['ancestry-of', search_result.start_key]
 
1429
        else:
 
1430
            recipe = search_result.get_recipe()
 
1431
            parts = ['search', self._serialise_search_recipe(recipe)]
 
1432
        return '\n'.join(parts)
 
1433
 
1426
1434
    def autopack(self):
1427
1435
        path = self.bzrdir._path_for_remote_call(self._client)
1428
1436
        try:
1515
1523
            return repository.StreamSource.get_stream(self, search)
1516
1524
        path = repo.bzrdir._path_for_remote_call(client)
1517
1525
        try:
1518
 
            if isinstance(search, graph.MiniSearchResult):
1519
 
                start_keys = [search.start_key]
1520
 
                stop_keys = [NULL_REVISION]
1521
 
                count = 'n/a'
1522
 
                recipe = (start_keys, stop_keys, count)
1523
 
            else:
1524
 
                recipe = search._recipe
1525
 
            recipe = repo._serialise_search_recipe(recipe)
 
1526
            search_bytes = repo._serialise_search_result(search)
1526
1527
            response = repo._call_with_body_bytes_expecting_body(
1527
1528
                'Repository.get_stream',
1528
 
                (path, self.to_format.network_name()), recipe)
 
1529
                (path, self.to_format.network_name()), search_bytes)
1529
1530
            response_tuple, response_handler = response
1530
1531
        except errors.UnknownSmartMethod:
1531
1532
            medium._remember_remote_is_before((1,13))