~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Aaron Bentley
  • Date: 2005-12-25 00:38:48 UTC
  • mto: (1185.67.11 bzr.revision-storage)
  • mto: This revision was merged to the branch mainline in revision 1550.
  • Revision ID: aaron.bentley@utoronto.ca-20051225003848-111ac71170cb2605
Renamed Branch.storage to Branch.repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
301
301
 
302
302
        If there are no revisions yet, return an `EmptyTree`.
303
303
        """
304
 
        return self.storage.revision_tree(self.last_revision())
 
304
        return self.repository.revision_tree(self.last_revision())
305
305
 
306
306
    def rename_one(self, from_rel, to_rel):
307
307
        """Rename one file.
472
472
        if init:
473
473
            self._make_control()
474
474
        self._check_format(relax_version_check)
475
 
        self.storage = Repository(transport, self._branch_format)
 
475
        self.repository = Repository(transport, self._branch_format)
476
476
 
477
477
    def __str__(self):
478
478
        return '%s(%r)' % (self.__class__.__name__, self.base)
594
594
    @needs_read_lock
595
595
    def get_root_id(self):
596
596
        """See Branch.get_root_id."""
597
 
        inv = self.storage.get_inventory(self.last_revision())
 
597
        inv = self.repository.get_inventory(self.last_revision())
598
598
        return inv.root.file_id
599
599
 
600
600
    def lock_write(self):
601
601
        # TODO: test for failed two phase locks. This is known broken.
602
602
        self.control_files.lock_write()
603
 
        self.storage.lock_write()
 
603
        self.repository.lock_write()
604
604
 
605
605
    def lock_read(self):
606
606
        # TODO: test for failed two phase locks. This is known broken.
607
607
        self.control_files.lock_read()
608
 
        self.storage.lock_read()
 
608
        self.repository.lock_read()
609
609
 
610
610
    def unlock(self):
611
611
        # TODO: test for failed two phase locks. This is known broken.
612
 
        self.storage.unlock()
 
612
        self.repository.unlock()
613
613
        self.control_files.unlock()
614
614
 
615
615
    @needs_read_lock
616
616
    def print_file(self, file, revision_id):
617
617
        """See Branch.print_file."""
618
 
        return self.storage.print_file(file, revision_id)
 
618
        return self.repository.print_file(file, revision_id)
619
619
 
620
620
    @needs_write_lock
621
621
    def append_revision(self, *revision_ids):
655
655
 
656
656
        # revno is 1-based; list is 0-based
657
657
 
658
 
        new_tree = self.storage.revision_tree(rh[revno-1])
 
658
        new_tree = self.repository.revision_tree(rh[revno-1])
659
659
        if revno == 1:
660
660
            old_tree = EmptyTree()
661
661
        else:
662
 
            old_tree = self.storage.revision_tree(rh[revno-2])
 
662
            old_tree = self.repository.revision_tree(rh[revno-2])
663
663
        return compare_trees(old_tree, new_tree)
664
664
 
665
665
    @needs_read_lock
703
703
            try:
704
704
                pullable_revs = get_intervening_revisions(self.last_revision(),
705
705
                                                          stop_revision, 
706
 
                                                          self.storage)
 
706
                                                          self.repository)
707
707
                assert self.last_revision() not in pullable_revs
708
708
                return pullable_revs
709
709
            except bzrlib.errors.NotAncestor:
722
722
            # that for a working tree. RBC 20051207
723
723
            xml = self.working_tree().read_basis_inventory(revision_id)
724
724
            inv = bzrlib.xml5.serializer_v5.read_inventory_from_string(xml)
725
 
            return RevisionTree(self.storage.weave_store, inv, revision_id)
 
725
            return RevisionTree(self.repository.weave_store, inv, revision_id)
726
726
        except (IndexError, NoSuchFile, NoWorkingTree), e:
727
 
            return self.storage.revision_tree(self.last_revision())
 
727
            return self.repository.revision_tree(self.last_revision())
728
728
 
729
729
    def working_tree(self):
730
730
        """See Branch.working_tree."""
811
811
        mutter("copy branch from %s to %s", self, branch_to)
812
812
        branch_to.working_tree().set_root_id(self.get_root_id())
813
813
 
814
 
        self.storage.copy(branch_to.storage)
 
814
        self.repository.copy(branch_to.repository)
815
815
        
816
816
        # must be done *after* history is copied across
817
817
        # FIXME duplicate code with base .clone().
829
829
            to_branch_type = BzrBranch
830
830
 
831
831
        if to_branch_type == BzrBranch \
832
 
            and self.storage.weave_store.listable() \
833
 
            and self.storage.revision_store.listable():
 
832
            and self.repository.weave_store.listable() \
 
833
            and self.repository.revision_store.listable():
834
834
            return self._clone_weave(to_location, revision, basis_branch)
835
835
 
836
836
        return Branch.clone(self, to_location, revision, basis_branch, to_branch_type)