~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf.py

  • Committer: Aaron Bentley
  • Date: 2008-10-27 11:55:36 UTC
  • mto: (0.12.75 shelf-manager)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081027115536-12hmhtfxe6dd2gue
Replace assert with proper error handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
            shelf_file.close()
259
259
        records = iter(parser.read_pending_records())
260
260
        names, metadata_bytes = records.next()
261
 
        assert names[0] == ('metadata',)
 
261
        if names[0] != ('metadata',):
 
262
            raise errors.ShelfCorrupt
262
263
        metadata = bencode.bdecode(metadata_bytes)
263
264
        base_revision_id = metadata['revision_id']
264
265
        message = metadata.get('message')