~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-26 19:08:21 UTC
  • mto: This revision was merged to the branch mainline in revision 2982.
  • Revision ID: john@arbash-meinel.com-20071026190821-ol840ac6hknunpqd
Switch from using Tree.inventory.root.file_id() to using Tree.path2id('')

Show diffs side-by-side

added added

removed removed

Lines of Context:
495
495
            return None
496
496
        # the file is old; the old id is still valid
497
497
        if self._new_root == trans_id:
498
 
            return self._tree.inventory.root.file_id
 
498
            return self._tree.path2id('')
499
499
        return self._tree.inventory.path2id(path)
500
500
 
501
501
    def final_file_id(self, trans_id):
905
905
                        self.rename_count += 1
906
906
                if trans_id in self._removed_id:
907
907
                    if trans_id == self._new_root:
908
 
                        file_id = self._tree.inventory.root.file_id
 
908
                        file_id = self._tree.path2id('')
909
909
                    else:
910
910
                        file_id = self.tree_file_id(trans_id)
911
911
                    assert file_id is not None
1283
1283
        # is set within the tree, nor setting the root and thus
1284
1284
        # marking the tree as dirty, because we use two different
1285
1285
        # idioms here: tree interfaces and inventory interfaces.
1286
 
        if wt.path2id('') != tree.inventory.root.file_id:
1287
 
            wt.set_root_id(tree.inventory.root.file_id)
 
1286
        if wt.path2id('') != tree.path2id(''):
 
1287
            wt.set_root_id(tree.path2id(''))
1288
1288
            wt.flush()
1289
1289
    tt = TreeTransform(wt)
1290
1290
    divert = set()