~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

Implement RemoteRepository.is_shared (Robert Collins, Vincent Ladeuil).

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
            return SmartServerResponse(('ok', ))
57
57
        else:
58
58
            return SmartServerResponse(('no', ))
 
59
 
 
60
 
 
61
class SmartServerRepositoryIsShared(SmartServerRepositoryRequest):
 
62
 
 
63
    def do_repository_request(self, repository):
 
64
        """Return the result of repository.is_shared().
 
65
 
 
66
        :param repository: The repository to query in.
 
67
        :return: A smart server response of ('yes', ) if the repository is
 
68
            shared, and ('no', ) if it is not.
 
69
        """
 
70
        if repository.is_shared():
 
71
            return SmartServerResponse(('yes', ))
 
72
        else:
 
73
            return SmartServerResponse(('no', ))