~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/memorytree.py

  • Committer: Robert Collins
  • Date: 2008-09-23 02:16:55 UTC
  • mfrom: (3723 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3725.
  • Revision ID: robertc@robertcollins.net-20080923021655-w6fiwcz42r9ju9xs
Adjust for trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    def create_on_branch(branch):
69
69
        """Create a MemoryTree for branch, using the last-revision of branch."""
70
70
        revision_id = _mod_revision.ensure_null(branch.last_revision())
71
 
        if _mod_revision.is_null(revision_id):
72
 
            revision_id = None
73
71
        return MemoryTree(branch, revision_id)
74
72
 
75
73
    def _gather_kinds(self, files, kinds):
206
204
        """Populate the in-tree state from the branch."""
207
205
        self._basis_tree = self.branch.repository.revision_tree(
208
206
            self._branch_revision_id)
209
 
        if self._branch_revision_id is None:
 
207
        if self._branch_revision_id == _mod_revision.NULL_REVISION:
210
208
            self._parent_ids = []
211
209
        else:
212
210
            self._parent_ids = [self._branch_revision_id]
272
270
            _mod_revision.check_not_reserved_id(revision_id)
273
271
        if len(revision_ids) == 0:
274
272
            self._parent_ids = []
275
 
            self._basis_tree = self.branch.repository.revision_tree(None)
 
273
            self._basis_tree = self.branch.repository.revision_tree(
 
274
                                    _mod_revision.NULL_REVISION)
276
275
        else:
277
276
            self._parent_ids = revision_ids
278
277
            self._basis_tree = self.branch.repository.revision_tree(
283
282
        """See MutableTree.set_parent_trees()."""
284
283
        if len(parents_list) == 0:
285
284
            self._parent_ids = []
286
 
            self._basis_tree = self.branch.repository.revision_tree(None)
 
285
            self._basis_tree = self.branch.repository.revision_tree(
 
286
                                   _mod_revision.NULL_REVISION)
287
287
        else:
288
288
            if parents_list[0][1] is None and not allow_leftmost_as_ghost:
289
289
                # a ghost in the left most parent
290
290
                raise errors.GhostRevisionUnusableHere(parents_list[0][0])
291
291
            self._parent_ids = [parent_id for parent_id, tree in parents_list]
292
292
            if parents_list[0][1] is None or parents_list[0][1] == 'null:':
293
 
                self._basis_tree = self.branch.repository.revision_tree(None)
 
293
                self._basis_tree = self.branch.repository.revision_tree(
 
294
                                       _mod_revision.NULL_REVISION)
294
295
            else:
295
296
                self._basis_tree = parents_list[0][1]
296
297
            self._branch_revision_id = parents_list[0][0]