~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Implemented final_file_id

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
                else:
115
115
                    raise NoSuchFile(path)
116
116
 
 
117
    def final_file_id(self, trans_id):
 
118
        """Determine the file id currently assigned, or None."""
 
119
        try:
 
120
            # there is a new id for this file
 
121
            return self._new_id[trans_id]
 
122
        except KeyError:
 
123
            try:
 
124
                path = self._tree_id_paths[trans_id]
 
125
            except KeyError:
 
126
                # the file is a new, unversioned file, or invalid trans_id
 
127
                return None
 
128
            # the file is old; the old id is still valid
 
129
            return self._tree.path2id(path)
 
130
 
117
131
    def find_conflicts(self):
118
132
        """Find any violations of inventory of filesystem invariants"""
119
133
        by_parent = {}