~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

Implement RemoteRepository side of write group HPSS methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1009
1009
 
1010
1010
        :param suppress_errors: see Repository.abort_write_group.
1011
1011
        """
1012
 
        self._ensure_real()
1013
 
        return self._real_repository.abort_write_group(
1014
 
            suppress_errors=suppress_errors)
 
1012
        path = self.bzrdir._path_for_remote_call(self._client)
 
1013
        try:
 
1014
            response = self._call('Repository.abort_write_group', path,
 
1015
                suppress_errors)
 
1016
        except errors.UnknownSmartMethod:
 
1017
            self._ensure_real()
 
1018
            return self._real_repository.abort_write_group(
 
1019
                suppress_errors=suppress_errors)
 
1020
        if response != ('ok', ):
 
1021
            raise errors.UnexpectedSmartServerResponse(response)
1015
1022
 
1016
1023
    @property
1017
1024
    def chk_bytes(self):
1031
1038
        for older plugins that don't use e.g. the CommitBuilder
1032
1039
        facility.
1033
1040
        """
1034
 
        self._ensure_real()
1035
 
        return self._real_repository.commit_write_group()
 
1041
        path = self.bzrdir._path_for_remote_call(self._client)
 
1042
        try:
 
1043
            response = self._call('Repository.commit_write_group', path)
 
1044
        except errors.UnknownSmartMethod:
 
1045
            self._ensure_real()
 
1046
            return self._real_repository.commit_write_group()
 
1047
        if response != ('ok', ):
 
1048
            raise errors.UnexpectedSmartServerResponse(response)
1036
1049
 
1037
1050
    def resume_write_group(self, tokens):
1038
 
        self._ensure_real()
1039
 
        return self._real_repository.resume_write_group(tokens)
 
1051
        path = self.bzrdir._path_for_remote_call(self._client)
 
1052
        try:
 
1053
            response = self._call('Repository.resume_write_group', path,
 
1054
                *tokens)
 
1055
        except errors.UnknownSmartMethod:
 
1056
            self._ensure_real()
 
1057
            return self._real_repository.resume_write_group(tokens)
 
1058
        if response != ('ok', ):
 
1059
            raise errors.UnexpectedSmartServerResponse(response)
1040
1060
 
1041
1061
    def suspend_write_group(self):
1042
 
        self._ensure_real()
1043
 
        return self._real_repository.suspend_write_group()
 
1062
        path = self.bzrdir._path_for_remote_call(self._client)
 
1063
        try:
 
1064
            response = self._call('Repository.suspend_write_group',
 
1065
                path)
 
1066
        except errors.UnknownSmartMethod:
 
1067
            self._ensure_real()
 
1068
            return self._real_repository.suspend_write_group()
 
1069
        if response[0] != 'ok':
 
1070
            raise errors.UnexpectedSmartServerResponse(response)
 
1071
        return list(response[1:])
1044
1072
 
1045
1073
    def get_missing_parent_inventories(self, check_for_missing_texts=True):
1046
1074
        self._ensure_real()
1414
1442
        for older plugins that don't use e.g. the CommitBuilder
1415
1443
        facility.
1416
1444
        """
1417
 
        self._ensure_real()
1418
 
        return self._real_repository.start_write_group()
 
1445
        path = self.bzrdir._path_for_remote_call(self._client)
 
1446
        try:
 
1447
            response = self._call('Repository.start_write_group', path)
 
1448
        except errors.UnknownSmartMethod:
 
1449
            self._ensure_real()
 
1450
            return self._real_repository.start_write_group()
 
1451
        if response != ('ok', ):
 
1452
            raise errors.UnexpectedSmartServerResponse(response)
1419
1453
 
1420
1454
    def _unlock(self, token):
1421
1455
        path = self.bzrdir._path_for_remote_call(self._client)