~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1339
1339
                    minikind = child[1][0][0]
1340
1340
                    fingerprint = child[1][0][4]
1341
1341
                    executable = child[1][0][3]
1342
 
                    old_child_path = osutils.pathjoin(child[0][0],
1343
 
                                                      child[0][1])
 
1342
                    old_child_path = osutils.pathjoin(child_dirname,
 
1343
                                                      child_basename)
1344
1344
                    removals[child[0][2]] = old_child_path
1345
1345
                    child_suffix = child_dirname[len(old_path):]
1346
1346
                    new_child_dirname = (new_path + child_suffix)
1347
1347
                    key = (new_child_dirname, child_basename, child[0][2])
1348
 
                    new_child_path = os.path.join(new_child_dirname,
1349
 
                                                  child_basename)
 
1348
                    new_child_path = osutils.pathjoin(new_child_dirname,
 
1349
                                                      child_basename)
1350
1350
                    insertions[child[0][2]] = (key, minikind, executable,
1351
1351
                                               fingerprint, new_child_path)
1352
1352
        self._check_delta_ids_absent(new_ids, delta, 0)
1997
1997
                entry_index, present = self._find_entry_index(key, block)
1998
1998
                if present:
1999
1999
                    entry = self._dirblocks[block_index][1][entry_index]
 
2000
                    # TODO: We might want to assert that entry[0][2] ==
 
2001
                    #       fileid_utf8.
2000
2002
                    if entry[1][tree_index][0] in 'fdlt':
2001
2003
                        # this is the result we are looking for: the
2002
2004
                        # real home of this file_id in this tree.
2354
2356
        self.update_minimal(('', '', new_id), 'd',
2355
2357
            path_utf8='', packed_stat=entry[1][0][4])
2356
2358
        self._dirblock_state = DirState.IN_MEMORY_MODIFIED
2357
 
        if self._id_index is not None:
2358
 
            self._id_index.setdefault(new_id, set()).add(entry[0])
2359
2359
 
2360
2360
    def set_parent_trees(self, trees, ghosts):
2361
2361
        """Set the parent trees for the dirstate.
3013
3013
            if absent_positions == tree_count:
3014
3014
                raise AssertionError(
3015
3015
                    "entry %r has no data for any tree." % (entry,))
 
3016
        if self._id_index is not None:
 
3017
            for file_id, entry_keys in self._id_index.iteritems():
 
3018
                for entry_key in entry_keys:
 
3019
                    if entry_key[2] != file_id:
 
3020
                        raise AssertionError(
 
3021
                            'file_id %r did not match entry key %s'
 
3022
                            % (file_id, entry_key))
3016
3023
 
3017
3024
    def _wipe_state(self):
3018
3025
        """Forget all state information about the dirstate."""