/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/memorytree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-24 23:19:12 UTC
  • mfrom: (4190.1.6 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090324231912-rb0kgktzkvge8aea
(robertc) Negatively cache ghosts and misses during read-locks in
        RemoteRepository. (Robert Collins, Andrew Bennetts)

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()."""