~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Robert Collins
  • Date: 2009-07-10 05:18:29 UTC
  • mto: This revision was merged to the branch mainline in revision 4524.
  • Revision ID: robertc@robertcollins.net-20090710051829-zesmf7tf2jwohfip
Fix fallout from the delta checking work, don't error on deltas containing the root inventory item in CHK delta application, and clean up Inventory docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1459
1459
                        (source_path, target_path, entry[0][2], None, False))
1460
1460
                deletes.append(
1461
1461
                    (encode(old_path), new_path, file_id, None, False))
1462
 
                # note the parent for validation
1463
 
                dirname, basename = osutils.split(new_path)
1464
 
                parents.add((dirname, inv_entry.parent_id))
1465
1462
            else:
1466
1463
                # changes to just the root should not require remove/insertion
1467
1464
                # of everything.
1609
1606
            entry = self._get_entry(1, file_id, dirname)
1610
1607
            if entry[1] is None:
1611
1608
                self._changes_aborted = True
1612
 
                raise errors.InconsistentDelta(dirname, file_id,
 
1609
                raise errors.InconsistentDelta(dirname.decode('utf8'), file_id,
1613
1610
                    "This parent is not present.")
1614
1611
            # Parents of things must be directories
1615
1612
            if entry[1][1][0] != 'd':
1616
1613
                self._changes_aborted = True
1617
 
                raise errors.InconsistentDelta(dirname, file_id,
 
1614
                raise errors.InconsistentDelta(dirname.decode('utf8'), file_id,
1618
1615
                    "This parent is not a directory.")
1619
1616
 
1620
1617
    def _observed_sha1(self, entry, sha1, stat_value,
1865
1862
        self._read_dirblocks_if_needed()
1866
1863
        if path_utf8 is not None:
1867
1864
            if type(path_utf8) is not str:
1868
 
                raise AssertionError('path_utf8 is not a str: %s %s'
 
1865
                raise errors.BzrError('path_utf8 is not a str: %s %r'
1869
1866
                    % (type(path_utf8), path_utf8))
1870
1867
            # path lookups are faster
1871
1868
            dirname, basename = osutils.split(path_utf8)