~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Robert Collins
  • Date: 2009-07-09 23:04:39 UTC
  • mto: This revision was merged to the branch mainline in revision 4524.
  • Revision ID: robertc@robertcollins.net-20090709230439-vztby1svjthvodkv
Check for missing parents in deltas.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1268
1268
            try:
1269
1269
                parent = self._byid[entry.parent_id]
1270
1270
            except KeyError:
1271
 
                raise BzrError("parent_id {%s} not in inventory" %
1272
 
                               entry.parent_id)
1273
 
 
 
1271
                raise errors.InconsistentDelta("<unknown>", entry.parent_id,
 
1272
                    "Parent not in inventory.")
1274
1273
            if entry.name in parent.children:
1275
1274
                raise errors.InconsistentDelta(
1276
1275
                    self.id2path(parent.children[entry.name].file_id),
1682
1681
        if parent_id_basename_delta:
1683
1682
            result.parent_id_basename_to_file_id.apply_delta(parent_id_basename_delta)
1684
1683
        for parent in parents:
1685
 
            if result[parent].kind != 'directory':
1686
 
                raise errors.InconsistentDelta(result.id2path(parent), parent,
1687
 
                    'Not a directory, but given children')
 
1684
            try:
 
1685
                if result[parent].kind != 'directory':
 
1686
                    raise errors.InconsistentDelta(result.id2path(parent), parent,
 
1687
                        'Not a directory, but given children')
 
1688
            except errors.NoSuchId:
 
1689
                raise errors.InconsistentDelta("<unknown>", parent,
 
1690
                    "Parent is not present in resulting inventory.")
1688
1691
        return result
1689
1692
 
1690
1693
    @classmethod