~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: John Arbash Meinel
  • Date: 2013-05-23 10:04:17 UTC
  • mfrom: (6437.63.11 2.5)
  • mto: This revision was merged to the branch mainline in revision 6575.
  • Revision ID: john@arbash-meinel.com-20130523100417-i38zikta14q2xdyz
Merge lp:bzr/2.5 tip and move up the changelog items.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2566
2566
        self.update_minimal(('', '', new_id), 'd',
2567
2567
            path_utf8='', packed_stat=entry[1][0][4])
2568
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])
2576
2569
 
2577
2570
    def set_parent_trees(self, trees, ghosts):
2578
2571
        """Set the parent trees for the dirstate.
3285
3278
        if self._id_index is not None:
3286
3279
            for file_id, entry_keys in self._id_index.iteritems():
3287
3280
                for entry_key in entry_keys:
 
3281
                    # Check that the entry in the map is pointing to the same
 
3282
                    # file_id
3288
3283
                    if entry_key[2] != file_id:
3289
3284
                        raise AssertionError(
3290
3285
                            'file_id %r did not match entry key %s'
3291
3286
                            % (file_id, entry_key))
 
3287
                    # And that from this entry key, we can look up the original
 
3288
                    # record
 
3289
                    block_index, present = self._find_block_index_from_key(entry_key)
 
3290
                    if not present:
 
3291
                        raise AssertionError('missing block for entry key: %r', entry_key)
 
3292
                    entry_index, present = self._find_entry_index(entry_key, self._dirblocks[block_index][1])
 
3293
                    if not present:
 
3294
                        raise AssertionError('missing entry for key: %r', entry_key)
3292
3295
                if len(entry_keys) != len(set(entry_keys)):
3293
3296
                    raise AssertionError(
3294
3297
                        'id_index contained non-unique data for %s'