/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: Jelmer Vernooij
  • Date: 2009-03-28 14:24:46 UTC
  • mfrom: (4211 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4212.
  • Revision ID: jelmer@samba.org-20090328142446-vqi0ksswdurga631
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""MemoryTree object.
18
18
 
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()."""