~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

Deprecate EmptyTree in favour of using Repository.revision_tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import os
21
21
from cStringIO import StringIO
 
22
from warnings import warn
22
23
 
23
24
import bzrlib
24
25
from bzrlib.errors import BzrError, BzrCheckError
28
29
import bzrlib.revision
29
30
from bzrlib.trace import mutter, note
30
31
 
 
32
 
31
33
class Tree(object):
32
34
    """Abstract file tree.
33
35
 
37
39
 
38
40
    * `RevisionTree` is a tree as recorded at some point in the past.
39
41
 
40
 
    * `EmptyTree`
41
 
 
42
42
    Trees contain an `Inventory` object, and also know how to retrieve
43
43
    file texts mentioned in the inventory, either from a working
44
44
    directory or from a store.
242
242
 
243
243
    def __init__(self):
244
244
        self._inventory = Inventory()
 
245
        warn('EmptyTree is deprecated as of bzr 0.9 please use '
 
246
            'repository.revision_tree instead.',
 
247
            DeprecationWarning, stacklevel=2)
245
248
 
246
249
    def get_parent_ids(self):
247
 
        """See Tree.get_parent_ids.
248
 
 
249
 
        An EmptyTree always has NULL_REVISION as the only parent.
250
 
        """
251
250
        return []
252
251
 
253
252
    def get_symlink_target(self, file_id):