~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: John Arbash Meinel
  • Date: 2013-06-24 12:03:12 UTC
  • mfrom: (6437.77.2 2.5)
  • mto: This revision was merged to the branch mainline in revision 6579.
  • Revision ID: john@arbash-meinel.com-20130624120312-pmvck24x052csigx
Merge lp:bzr/2.5 r6515 to get the fix for bug #855155 (Dirstate.update_basis_by_delta)

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: