~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2006-08-11 05:28:55 UTC
  • mto: (1908.6.4 use set_parent_trees.)
  • mto: This revision was merged to the branch mainline in revision 1972.
  • Revision ID: robertc@robertcollins.net-20060811052855-d3622775878f20db
Add add_parent_tree to WorkingTree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
654
654
        self.set_parent_ids(self.get_parent_ids() + [revision_id])
655
655
 
656
656
    @needs_write_lock
 
657
    def add_parent_tree(self, parent_tuple):
 
658
        """Add revision_id, tree tuple as a parent.
 
659
 
 
660
        This is equivalent to retrieving the current list of parent trees
 
661
        and setting the list to its value plus parent_tuple. See also
 
662
        add_parent_tree_id - if you only have a parent id available it will be
 
663
        simpler to use that api. If you have the parent already available, using
 
664
        this api is preferred.
 
665
 
 
666
        :param parent_tuple: The (revision id, tree) to add to the parent list.             If the revision_id is a ghost, pass None for the tree.
 
667
        """
 
668
        self.set_parent_ids(self.get_parent_ids() + [parent_tuple[0]])
 
669
 
 
670
    @needs_write_lock
657
671
    def add_pending_merge(self, *revision_ids):
658
672
        # TODO: Perhaps should check at this point that the
659
673
        # history of the revision is actually present?