~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-11-05 15:23:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1503.
  • Revision ID: robertc@robertcollins.net-20051105152357-2b072e3f033d6596
Move set_root_id to WorkingTree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
518
518
        return inv.root.file_id
519
519
 
520
520
    @needs_write_lock
521
 
    def set_root_id(self, file_id):
522
 
        inv = self.working_tree().read_working_inventory()
523
 
        orig_root_id = inv.root.file_id
524
 
        del inv._byid[inv.root.file_id]
525
 
        inv.root.file_id = file_id
526
 
        inv._byid[inv.root.file_id] = inv.root
527
 
        for fid in inv:
528
 
            entry = inv[fid]
529
 
            if entry.parent_id in (None, orig_root_id):
530
 
                entry.parent_id = inv.root.file_id
531
 
        self._write_inventory(inv)
532
 
 
533
 
    @needs_write_lock
534
521
    def _write_inventory(self, inv):
535
522
        """Update the working inventory.
536
523