~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-26 21:33:20 UTC
  • mfrom: (3015.2.15 pack.read-locks)
  • Revision ID: pqm@pqm.ubuntu.com-20071126213320-adxxra3gsie5inhw
(robertc) Many fixes to support packs on the smart server and as the
        default format. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
        except errors.LockFailed, e:
169
169
            return FailedSmartServerResponse(('LockFailed',
170
170
                str(e.lock), str(e.why)))
171
 
        repository.leave_lock_in_place()
 
171
        if token is not None:
 
172
            repository.leave_lock_in_place()
172
173
        repository.unlock()
173
174
        if token is None:
174
175
            token = ''
249
250
class SmartServerRepositoryStreamKnitDataForRevisions(SmartServerRepositoryRequest):
250
251
 
251
252
    def do_repository_request(self, repository, *revision_ids):
 
253
        repository.lock_read()
 
254
        try:
 
255
            return self._do_repository_request(repository, revision_ids)
 
256
        finally:
 
257
            repository.unlock()
 
258
 
 
259
    def _do_repository_request(self, repository, revision_ids):
252
260
        stream = repository.get_data_stream(revision_ids)
253
261
        filelike = StringIO()
254
262
        pack = ContainerWriter(filelike.write)