/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2006-08-09 11:14:45 UTC
  • mto: (1908.6.2 use set_parent_trees.)
  • mto: This revision was merged to the branch mainline in revision 1972.
  • Revision ID: robertc@robertcollins.net-20060809111445-3a5e9647faf96fc0
Add add_parent_tree_id WorkingTree helper api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
642
642
        self._write_inventory(inv)
643
643
 
644
644
    @needs_write_lock
 
645
    def add_parent_tree_id(self, revision_id):
 
646
        """Add revision_id as a parent.
 
647
 
 
648
        This is equivalent to retrieving the current list of parent ids
 
649
        and setting the list to its value plus revision_id.
 
650
 
 
651
        :param revision_id: The revision id to add to the parent list. It may
 
652
        be a ghost revision.
 
653
        """
 
654
        revision_ids = self.get_parent_ids() + [revision_id]
 
655
        trees = []
 
656
        for rev_id in revision_ids:
 
657
            try:
 
658
                trees.append(
 
659
                    (rev_id, self.branch.repository.revision_tree(rev_id)))
 
660
            except errors.RevisionNotPresent:
 
661
                trees.append((rev_id, None))
 
662
                pass
 
663
        self.set_parent_trees(trees)
 
664
 
 
665
    @needs_write_lock
645
666
    def add_pending_merge(self, *revision_ids):
646
667
        # TODO: Perhaps should check at this point that the
647
668
        # history of the revision is actually present?