~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Martin Pool
  • Date: 2005-08-02 13:56:14 UTC
  • Revision ID: mbp@sourcefrog.net-20050802135614-01365d7cbdb62854
- ignore setup.py build directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tree classes, representing directory at point in time.
18
18
"""
19
19
 
20
 
from osutils import pumpfile, appendpath, fingerprint_file
21
20
import os
22
21
 
 
22
import bzrlib
23
23
from bzrlib.trace import mutter, note
24
24
from bzrlib.errors import BzrError
 
25
from bzrlib.inventory import Inventory
 
26
from bzrlib.osutils import pumpfile, appendpath, fingerprint_file
25
27
 
26
 
import bzrlib
27
28
 
28
29
exporters = {}
29
30
 
66
67
 
67
68
    def _get_inventory(self):
68
69
        return self._inventory
 
70
    
 
71
    def get_file_by_path(self, path):
 
72
        return self.get_file(self._inventory.path2id(path))
69
73
 
70
74
    inventory = property(_get_inventory,
71
75
                         doc="Inventory of this Tree")
143
147
 
144
148
 
145
149
class EmptyTree(Tree):
146
 
    def __init__(self, root_id):
147
 
        from bzrlib.inventory import Inventory
148
 
        self._inventory = Inventory(root_id)
 
150
    def __init__(self):
 
151
        self._inventory = Inventory()
149
152
 
150
153
    def has_filename(self, filename):
151
154
        return False