~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Martin Pool
  • Date: 2007-06-27 06:33:31 UTC
  • mto: This revision was merged to the branch mainline in revision 2584.
  • Revision ID: mbp@sourcefrog.net-20070627063331-42nj4x28k15zmqan
Better messages from assertContainsRe

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        elif response == ('nobranch',):
111
111
            raise errors.NotBranchError(path=self.root_transport.base)
112
112
        else:
113
 
            raise errors.UnexpectedSmartServerResponse(response)
 
113
            assert False, 'unexpected response code %r' % (response,)
114
114
 
115
115
    def open_branch(self, _unsupported=False):
116
116
        assert _unsupported == False, 'unsupported flag support not implemented yet.'
367
367
        elif response[0] == 'UnlockableTransport':
368
368
            raise errors.UnlockableTransport(self.bzrdir.root_transport)
369
369
        else:
370
 
            raise errors.UnexpectedSmartServerResponse(response)
 
370
            assert False, 'unexpected response code %s' % (response,)
371
371
 
372
372
    def lock_write(self, token=None):
373
373
        if not self._lock_mode:
416
416
        elif response[0] == 'TokenMismatch':
417
417
            raise errors.TokenMismatch(token, '(remote token)')
418
418
        else:
419
 
            raise errors.UnexpectedSmartServerResponse(response)
 
419
            assert False, 'unexpected response code %s' % (response,)
420
420
 
421
421
    def unlock(self):
422
422
        self._lock_count -= 1
633
633
        # TODO: Suggestion from john: using external tar is much faster than
634
634
        # python's tarfile library, but it may not work on windows.
635
635
 
636
 
    @needs_write_lock
637
 
    def pack(self):
638
 
        """Compress the data within the repository.
639
 
 
640
 
        This is not currently implemented within the smart server.
641
 
        """
642
 
        self._ensure_real()
643
 
        return self._real_repository.pack()
644
 
 
645
636
    def set_make_working_trees(self, new_value):
646
637
        raise NotImplementedError(self.set_make_working_trees)
647
638
 
858
849
        elif response[0] == 'ReadOnlyError':
859
850
            raise errors.ReadOnlyError(self)
860
851
        else:
861
 
            raise errors.UnexpectedSmartServerResponse(response)
 
852
            assert False, 'unexpected response code %r' % (response,)
862
853
            
863
854
    def lock_write(self, token=None):
864
855
        if not self._lock_mode:
908
899
            raise errors.TokenMismatch(
909
900
                str((branch_token, repo_token)), '(remote tokens)')
910
901
        else:
911
 
            raise errors.UnexpectedSmartServerResponse(response)
 
902
            assert False, 'unexpected response code %s' % (response,)
912
903
 
913
904
    def unlock(self):
914
905
        self._lock_count -= 1