~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

  • Committer: Robert Collins
  • Date: 2005-10-30 23:58:46 UTC
  • Revision ID: robertc@robertcollins.net-20051030235846-fda8b626748cce52
Move Branch.read_working_inventory to WorkingTree.

Branch.read_working_inventory has moved to
WorkingTree.read_working_inventory. This necessitated changes to
Branch.get_root_id, and a move of Branch.set_inventory to WorkingTree
as well. To make it clear that a WorkingTree cannot always be obtained
Branch.working_tree() will raise 'errors.NoWorkingTree' if one cannot
be obtained. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
                        rename(new_name, name)
112
112
                        self.this_tree.branch.rename_one(relpath, new_path)
113
113
                        assert self.this_tree.id2path(file_id) == relpath
114
 
                        self.this_tree._inventory = self.this_tree.branch.inventory
 
114
                        self.this_tree._inventory = self.this_tree.read_working_inventory()
115
115
                        assert self.this_tree.id2path(file_id) == new_path
116
116
        except OSError, e:
117
117
            if e.errno != errno.EEXIST and e.errno != errno.ENOTEMPTY:
523
523
                path = path[2:]
524
524
            adjust_ids.append((path, id))
525
525
        if len(adjust_ids) > 0:
526
 
            self.this_branch.set_inventory(self.regen_inventory(adjust_ids))
 
526
            self.this_branch.working_tree().set_inventory(self.regen_inventory(adjust_ids))
527
527
        conflicts = self.conflict_handler.conflicts
528
528
        self.conflict_handler.finalize()
529
529
        return conflicts
530
530
 
531
531
    def regen_inventory(self, new_entries):
532
 
        old_entries = self.this_branch.read_working_inventory()
 
532
        old_entries = self.this_branch.working_tree().read_working_inventory()
533
533
        new_inventory = {}
534
534
        by_path = {}
535
535
        new_entries_map = {}