~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

(jelmer) Add HPSS call for ``Repository.get_signature_text``. (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2054
2054
 
2055
2055
    @needs_read_lock
2056
2056
    def get_signature_text(self, revision_id):
2057
 
        self._ensure_real()
2058
 
        return self._real_repository.get_signature_text(revision_id)
 
2057
        path = self.bzrdir._path_for_remote_call(self._client)
 
2058
        try:
 
2059
            response_tuple, response_handler = self._call_expecting_body(
 
2060
                'Repository.get_revision_signature_text', path, revision_id)
 
2061
        except errors.UnknownSmartMethod:
 
2062
            self._ensure_real()
 
2063
            return self._real_repository.get_signature_text(revision_id)
 
2064
        except errors.NoSuchRevision, err:
 
2065
            for fallback in self._fallback_repositories:
 
2066
                try:
 
2067
                    return fallback.get_signature_text(revision_id)
 
2068
                except errors.NoSuchRevision:
 
2069
                    pass
 
2070
            raise err
 
2071
        else:
 
2072
            if response_tuple[0] != 'ok':
 
2073
                raise errors.UnexpectedSmartServerResponse(response_tuple)
 
2074
            return response_handler.read_body_bytes()
2059
2075
 
2060
2076
    @needs_read_lock
2061
2077
    def _get_inventory_xml(self, revision_id):
2338
2354
                revision_id)
2339
2355
        if response[0] not in ('yes', 'no'):
2340
2356
            raise SmartProtocolError('unexpected response code %s' % (response,))
2341
 
        return (response[0] == 'yes')
 
2357
        if response[0] == 'yes':
 
2358
            return True
 
2359
        for fallback in self._fallback_repositories:
 
2360
            if fallback.has_signature_for_revision_id(revision_id):
 
2361
                return True
 
2362
        return False
2342
2363
 
2343
2364
    @needs_read_lock
2344
2365
    def verify_revision_signature(self, revision_id, gpg_strategy):
2545
2566
 
2546
2567
    def _real_stream(self, repo, search):
2547
2568
        """Get a stream for search from repo.
2548
 
        
2549
 
        This never called RemoteStreamSource.get_stream, and is a heler
2550
 
        for RemoteStreamSource._get_stream to allow getting a stream 
 
2569
 
 
2570
        This never called RemoteStreamSource.get_stream, and is a helper
 
2571
        for RemoteStreamSource._get_stream to allow getting a stream
2551
2572
        reliably whether fallback back because of old servers or trying
2552
2573
        to stream from a non-RemoteRepository (which the stacked support
2553
2574
        code will do).
3729
3750
        return self._bzrdir._real_bzrdir
3730
3751
 
3731
3752
 
3732
 
 
3733
3753
def _extract_tar(tar, to_dir):
3734
3754
    """Extract all the contents of a tarfile object.
3735
3755