~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-17 17:16:11 UTC
  • mfrom: (3290 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080317171611-o9wdrnf0m7qwo198
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
386
386
        pack = ContainerSerialiser()
387
387
        buffer.write(pack.begin())
388
388
        try:
389
 
            for name_tuple, bytes in stream:
390
 
                buffer.write(pack.bytes_record(bytes, [name_tuple]))
 
389
            try:
 
390
                for name_tuple, bytes in stream:
 
391
                    buffer.write(pack.bytes_record(bytes, [name_tuple]))
 
392
            except:
 
393
                # Undo the lock_read that happens once the iterator from
 
394
                # get_data_stream is started.
 
395
                repository.unlock()
 
396
                raise
391
397
        except errors.RevisionNotPresent, e:
392
398
            return FailedSmartServerResponse(('NoSuchRevision', e.revision_id))
393
399
        buffer.write(pack.end())
403
409
        try:
404
410
            search, error = self.recreate_search(repository, body_bytes)
405
411
            if error is not None:
 
412
                repository.unlock()
406
413
                return error
407
414
            stream = repository.get_data_stream_for_search(search.get_result())
408
415
        except Exception: