~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1292
1292
                    parent_trees.append((parent_id, parent_tree))
1293
1293
                    parent_tree.lock_read()
1294
1294
                result.set_parent_trees(parent_trees, [])
1295
 
                result.set_state_from_inventory(tree.root_inventory)
 
1295
                result.set_state_from_inventory(tree.inventory)
1296
1296
            finally:
1297
1297
                for revid, parent_tree in parent_trees:
1298
1298
                    parent_tree.unlock()
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
 
                # 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
 
 
 
1651
                self._raise_invalid(new_path, file_id,
 
1652
                    "Unable to find block for this record."
 
1653
                    " Was the parent added?")
1663
1654
            block = self._dirblocks[block_index][1]
1664
1655
            entry_index, present = self._find_entry_index(entry_key, block)
1665
1656
            if real_add:
2575
2566
        self.update_minimal(('', '', new_id), 'd',
2576
2567
            path_utf8='', packed_stat=entry[1][0][4])
2577
2568
        self._mark_modified()
 
2569
        # XXX: This was added by Ian, we need to make sure there
 
2570
        #      are tests for it, because it isn't in bzr.dev TRUNK
 
2571
        #      It looks like the only place it is called is in setting the root
 
2572
        #      id of the tree. So probably we never had an _id_index when we
 
2573
        #      don't even have a root yet.
 
2574
        if self._id_index is not None:
 
2575
            self._add_to_id_index(self._id_index, entry[0])
2578
2576
 
2579
2577
    def set_parent_trees(self, trees, ghosts):
2580
2578
        """Set the parent trees for the dirstate.
3287
3285
        if self._id_index is not None:
3288
3286
            for file_id, entry_keys in self._id_index.iteritems():
3289
3287
                for entry_key in entry_keys:
3290
 
                    # Check that the entry in the map is pointing to the same
3291
 
                    # file_id
3292
3288
                    if entry_key[2] != file_id:
3293
3289
                        raise AssertionError(
3294
3290
                            'file_id %r did not match entry key %s'
3295
3291
                            % (file_id, entry_key))
3296
 
                    # And that from this entry key, we can look up the original
3297
 
                    # record
3298
 
                    block_index, present = self._find_block_index_from_key(entry_key)
3299
 
                    if not present:
3300
 
                        raise AssertionError('missing block for entry key: %r', entry_key)
3301
 
                    entry_index, present = self._find_entry_index(entry_key, self._dirblocks[block_index][1])
3302
 
                    if not present:
3303
 
                        raise AssertionError('missing entry for key: %r', entry_key)
3304
3292
                if len(entry_keys) != len(set(entry_keys)):
3305
3293
                    raise AssertionError(
3306
3294
                        'id_index contained non-unique data for %s'