/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

Create and test set_parent_trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
672
672
        return p
673
673
 
674
674
    @needs_write_lock
 
675
    def set_parent_trees(self, parents_list):
 
676
        """Set the parents of the working tree.
 
677
 
 
678
        :param parents_list: A list of (revision_id, tree) tuples. 
 
679
            If tree is None, then that element is treated as an unreachable
 
680
            parent tree - i.e. a ghost.
 
681
        """
 
682
        parent = parents_list[:1]
 
683
        if len(parent):
 
684
            self.set_last_revision(parent[0][0])
 
685
        else:
 
686
            self.set_last_revision(None)
 
687
        merges = parents_list[1:]
 
688
        self.set_pending_merges([revid for revid, tree in merges])
 
689
 
 
690
    @needs_write_lock
675
691
    def set_pending_merges(self, rev_list):
676
692
        self._control_files.put_utf8('pending-merges', '\n'.join(rev_list))
677
693