~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Aaron Bentley
  • Date: 2007-07-11 14:58:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2606.
  • Revision ID: abentley@panoramicfeedback.com-20070711145854-06486yosdvexapy1
Got all tests passing with Branch returning 'null:' for null revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
504
504
        value and uses that to decide what the parents list should be.
505
505
        """
506
506
        last_rev = self._last_revision()
507
 
        if last_rev is None:
 
507
        if _mod_revision.is_null(last_rev):
508
508
            parents = []
509
509
        else:
510
510
            parents = [last_rev]
735
735
        revision_ids = [osutils.safe_revision_id(r) for r in revision_ids]
736
736
        self._check_parents_for_ghosts(revision_ids,
737
737
            allow_leftmost_as_ghost=allow_leftmost_as_ghost)
 
738
        for revision_id in revision_ids:
 
739
            _mod_revision.check_not_reserved_id(revision_id)
738
740
 
739
741
        if len(revision_ids) > 0:
740
742
            self.set_last_revision(revision_ids[0])
747
749
    def set_parent_trees(self, parents_list, allow_leftmost_as_ghost=False):
748
750
        """See MutableTree.set_parent_trees."""
749
751
        parent_ids = [osutils.safe_revision_id(rev) for (rev, tree) in parents_list]
 
752
        for revision_id in parent_ids:
 
753
            _mod_revision.check_not_reserved_id(revision_id)
750
754
 
751
755
        self._check_parents_for_ghosts(parent_ids,
752
756
            allow_leftmost_as_ghost=allow_leftmost_as_ghost)
812
816
            else:
813
817
                to_revision = osutils.safe_revision_id(to_revision)
814
818
            merger.other_rev_id = to_revision
815
 
            if merger.other_rev_id is None:
 
819
            if _mod_revision.is_null(merger.other_rev_id):
816
820
                raise errors.NoCommits(branch)
817
821
            self.branch.fetch(branch, last_revision=merger.other_rev_id)
818
822
            merger.other_basis = merger.other_rev_id
2619
2623
        if basis_tree.inventory.root is not None:
2620
2624
            wt.set_root_id(basis_tree.inventory.root.file_id)
2621
2625
        # set the parent list and cache the basis tree.
2622
 
        wt.set_parent_trees([(revision, basis_tree)])
 
2626
        if _mod_revision.is_null(revision):
 
2627
            parent_trees = []
 
2628
        else:
 
2629
            parent_trees = [(revision, basis_tree)]
 
2630
        wt.set_parent_trees(parent_trees)
2623
2631
        transform.build_tree(basis_tree, wt)
2624
2632
        return wt
2625
2633