~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Patch Queue Manager
  • Date: 2013-06-24 13:05:33 UTC
  • mfrom: (6578.1.1 2.6-merges-2.5)
  • Revision ID: pqm@pqm.ubuntu.com-20130624130533-51c8htekjd8mix3u
(jameinel) Merge bzr/2.5 into trunk,
 including the fix for bug #855155 (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1648
1648
            entry_key = st(dirname, basename, file_id)
1649
1649
            block_index, present = self._find_block_index_from_key(entry_key)
1650
1650
            if not present:
1651
 
                self._raise_invalid(new_path, file_id,
1652
 
                    "Unable to find block for this record."
1653
 
                    " Was the parent added?")
 
1651
                # The block where we want to put the file is not present.
 
1652
                # However, it might have just been an empty directory. Look for
 
1653
                # the parent in the basis-so-far before throwing an error.
 
1654
                parent_dir, parent_base = osutils.split(dirname)
 
1655
                parent_block_idx, parent_entry_idx, _, parent_present = \
 
1656
                    self._get_block_entry_index(parent_dir, parent_base, 1)
 
1657
                if not parent_present:
 
1658
                    self._raise_invalid(new_path, file_id,
 
1659
                        "Unable to find block for this record."
 
1660
                        " Was the parent added?")
 
1661
                self._ensure_block(parent_block_idx, parent_entry_idx, dirname)
 
1662
 
1654
1663
            block = self._dirblocks[block_index][1]
1655
1664
            entry_index, present = self._find_entry_index(entry_key, block)
1656
1665
            if real_add: