~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

Bunch of test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
922
922
        """Commit a write group."""
923
923
        repository.lock_write(token=lock_token)
924
924
        try:
925
 
            repository.resume_write_group(write_group_tokens)
926
 
            repository.commit_write_group()
 
925
            try:
 
926
                repository.resume_write_group(write_group_tokens)
 
927
            except errors.UnresumableWriteGroup, e:
 
928
                return FailedSmartServerResponse(
 
929
                    ('UnresumableWriteGroup', e.write_groups, e.reason))
 
930
            try:
 
931
                repository.commit_write_group()
 
932
            except:
 
933
                write_group_tokens = repository.suspend_write_group()
 
934
                # FIXME JRV 2011-11-19: What if the write_group_tokens
 
935
                # have changed?
 
936
                raise
927
937
        finally:
928
938
            repository.unlock()
929
939
        return SuccessfulSmartServerResponse(('ok', ))
935
945
    New in 2.5.
936
946
    """
937
947
 
938
 
    def do_repository_request(self, repository, lock_token, write_group_tokens,
939
 
            suppress_errors):
 
948
    def do_repository_request(self, repository, lock_token, write_group_tokens):
940
949
        """Abort a write group."""
941
950
        repository.lock_write(token=lock_token)
942
951
        try:
943
 
            repository.resume_write_group(write_group_tokens)
944
 
            repository.abort_write_group(suppress_errors)
 
952
            try:
 
953
                repository.resume_write_group(write_group_tokens)
 
954
            except errors.UnresumableWriteGroup, e:
 
955
                return FailedSmartServerResponse(
 
956
                    ('UnresumableWriteGroup', e.write_groups, e.reason))
 
957
                repository.abort_write_group()
945
958
        finally:
946
959
            repository.unlock()
947
960
        return SuccessfulSmartServerResponse(('ok', ))