~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Made FinalPaths more correct

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
 
94
94
    def new_paths(self):
95
95
        new_ids = set()
96
 
        fp = FinalPaths(self._new_root, self._new_name, self._new_parent)
 
96
        fp = FinalPaths(self._new_root, self._new_name, self)
97
97
        for id_set in (self._new_name, self._new_parent, self._new_contents,
98
98
                       self._new_id):
99
99
            new_ids.update(id_set)
245
245
 
246
246
 
247
247
class FinalPaths(object):
248
 
    def __init__(self, root, names, parents):
 
248
    def __init__(self, root, names, tree):
249
249
        object.__init__(self)
250
250
        self.root = root
251
251
        self._new_name = names
252
 
        self._new_parent = parents
253
252
        self._known_paths = {}
 
253
        self.tree = tree
254
254
 
255
255
    def _determine_path(self, trans_id):
256
256
        if trans_id == self.root:
257
257
            return ""
258
258
        name = self._new_name[trans_id]
259
 
        parent_id = self._new_parent[trans_id]
 
259
        parent_id = self.tree.final_parent(trans_id)
260
260
        if parent_id == self.root:
261
261
            return name
262
262
        else: