~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

  • Committer: Parth Malwankar
  • Date: 2010-07-14 08:53:58 UTC
  • mto: (5050.3.7 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: parth.malwankar@gmail.com-20100714085358-6un4ny0cn908spkq
better error message for RecursiveBind

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
    def _validate_revision(self, inventory, revision_id):
290
290
        """Make sure all revision entries match their checksum."""
291
291
 
292
 
        # This is a mapping from each revision id to its sha hash
 
292
        # This is a mapping from each revision id to it's sha hash
293
293
        rev_to_sha1 = {}
294
294
 
295
295
        rev = self.get_revision(revision_id)
715
715
                ie.symlink_target = self.get_symlink_target(file_id)
716
716
            ie.revision = revision_id
717
717
 
718
 
            if kind == 'file':
 
718
            if kind in ('directory', 'symlink'):
 
719
                ie.text_size, ie.text_sha1 = None, None
 
720
            else:
719
721
                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)
 
722
            if (ie.text_size is None) and (kind == 'file'):
 
723
                raise BzrError('Got a text_size of None for file_id %r' % file_id)
723
724
            inv.add(ie)
724
725
 
725
726
        sorted_entries = self.sorted_path_id()