~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

Implement a remote Repository.has_revision method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
        if real_repository:
172
172
            self._real_repository = real_repository
173
173
        self.bzrdir = remote_bzrdir
 
174
        self._client = client.SmartClient(self.bzrdir.client)
174
175
        self._format = RemoteRepositoryFormat()
175
176
 
 
177
    def has_revision(self, revision_id):
 
178
        """See Repository.has_revision()."""
 
179
        path = self.bzrdir._path_for_remote_call().encode('utf8')
 
180
        response = self._client.call('Repository.has_revision', path, revision_id.encode('utf8'))
 
181
        assert response[0] in ('ok', 'no'), 'unexpected response code %s' % response[0]
 
182
        return response[0] == 'ok'
 
183
 
176
184
 
177
185
class RemoteBranchFormat(branch.BranchFormat):
178
186