~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

  • Committer: Martin Pool
  • Date: 2010-04-01 04:41:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5128.
  • Revision ID: mbp@sourcefrog.net-20100401044118-shyctqc02ob08ngz
ignore .testrepository

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
278
278
        if rev.revision_id != revision_id:
279
279
            raise AssertionError()
280
280
        if sha1 != rev.inventory_sha1:
281
 
            f = open(',,bogus-inv', 'wb')
282
 
            try:
283
 
                f.write(s)
284
 
            finally:
285
 
                f.close()
 
281
            open(',,bogus-inv', 'wb').write(s)
286
282
            warning('Inventory sha hash mismatch for revision %s. %s'
287
283
                    ' != %s' % (revision_id, sha1, rev.inventory_sha1))
288
284
 
331
327
                try:
332
328
                    name, value = info_item.split(':', 1)
333
329
                except ValueError:
334
 
                    raise ValueError('Value %r has no colon' % info_item)
 
330
                    raise 'Value %r has no colon' % info_item
335
331
                if name == 'last-changed':
336
332
                    last_changed = value
337
333
                elif name == 'executable':
715
711
                ie.symlink_target = self.get_symlink_target(file_id)
716
712
            ie.revision = revision_id
717
713
 
718
 
            if kind == 'file':
 
714
            if kind in ('directory', 'symlink'):
 
715
                ie.text_size, ie.text_sha1 = None, None
 
716
            else:
719
717
                ie.text_size, ie.text_sha1 = self.get_size_and_sha1(file_id)
720
 
                if ie.text_size is None:
721
 
                    raise BzrError(
722
 
                        'Got a text_size of None for file_id %r' % file_id)
 
718
            if (ie.text_size is None) and (kind == 'file'):
 
719
                raise BzrError('Got a text_size of None for file_id %r' % file_id)
723
720
            inv.add(ie)
724
721
 
725
722
        sorted_entries = self.sorted_path_id()