~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/memorytree.py

  • Committer: John Arbash Meinel
  • Date: 2009-03-26 16:35:00 UTC
  • mfrom: (4208 +trunk)
  • mto: (3735.40.9 vilajam)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090326163500-os7lvdpsdxnxstd0
Merge bzr.dev 4208.

This brings in some more smart-server improvements, 
as well as the iter_files_bytes as chunked, and 
multi-file and directory logging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
 
213
213
    def _populate_from_branch(self):
214
214
        """Populate the in-tree state from the branch."""
215
 
        self._basis_tree = self.branch.repository.revision_tree(
216
 
            self._branch_revision_id)
 
215
        self._set_basis()
217
216
        if self._branch_revision_id == _mod_revision.NULL_REVISION:
218
217
            self._parent_ids = []
219
218
        else:
280
279
            _mod_revision.check_not_reserved_id(revision_id)
281
280
        if len(revision_ids) == 0:
282
281
            self._parent_ids = []
283
 
            self._basis_tree = self.branch.repository.revision_tree(
284
 
                                    _mod_revision.NULL_REVISION)
 
282
            self._branch_revision_id = _mod_revision.NULL_REVISION
285
283
        else:
286
284
            self._parent_ids = revision_ids
287
 
            self._basis_tree = self.branch.repository.revision_tree(
288
 
                                    revision_ids[0])
289
285
            self._branch_revision_id = revision_ids[0]
 
286
        self._allow_leftmost_as_ghost = allow_leftmost_as_ghost
 
287
        self._set_basis()
 
288
    
 
289
    def _set_basis(self):
 
290
        try:
 
291
            self._basis_tree = self.branch.repository.revision_tree(
 
292
                self._branch_revision_id)
 
293
        except errors.NoSuchRevision:
 
294
            if self._allow_leftmost_as_ghost:
 
295
                self._basis_tree = self.branch.repository.revision_tree(
 
296
                    _mod_revision.NULL_REVISION)
 
297
            else:
 
298
                raise
290
299
 
291
300
    def set_parent_trees(self, parents_list, allow_leftmost_as_ghost=False):
292
301
        """See MutableTree.set_parent_trees()."""