~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

 * bzr add now lists how many files were ignored per glob.  add --verbose
   lists the specific files.  (Aaron Bentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
        """Print file with id `file_id` to stdout."""
105
105
        import sys
106
106
        sys.stdout.write(self.get_file_text(file_id))
107
 
 
108
 
    def lock_read(self):
109
 
        pass
110
 
 
111
 
    def unlock(self):
112
 
        pass
113
107
        
114
108
        
115
109
class RevisionTree(Tree):
122
116
           or at least passing a description to the constructor.
123
117
    """
124
118
    
125
 
    def __init__(self, branch, inv, revision_id):
126
 
        self._branch = branch
127
 
        self._weave_store = branch.weave_store
 
119
    def __init__(self, weave_store, inv, revision_id):
 
120
        self._weave_store = weave_store
128
121
        self._inventory = inv
129
122
        self._revision_id = revision_id
130
123
 
131
124
    def get_weave(self, file_id):
 
125
        # FIXME: RevisionTree should be given a branch
 
126
        # not a store, or the store should know the branch.
132
127
        import bzrlib.transactions as transactions
133
128
        return self._weave_store.get_weave(file_id,
134
 
                self._branch.get_transaction())
 
129
            transactions.PassThroughTransaction())
135
130
 
136
 
    def get_weave_prelude(self, file_id):
137
 
        import bzrlib.transactions as transactions
138
 
        return self._weave_store.get_weave_prelude(file_id,
139
 
                self._branch.get_transaction())
140
131
 
141
132
    def get_file_lines(self, file_id):
142
133
        ie = self._inventory[file_id]
143
134
        weave = self.get_weave(file_id)
144
135
        return weave.get(ie.revision)
 
136
        
145
137
 
146
138
    def get_file_text(self, file_id):
147
139
        return ''.join(self.get_file_lines(file_id))
148
140
 
 
141
 
149
142
    def get_file(self, file_id):
150
143
        return StringIO(self.get_file_text(file_id))
151
144
 
178
171
    def kind(self, file_id):
179
172
        return self._inventory[file_id].kind
180
173
 
181
 
    def lock_read(self):
182
 
        self._branch.lock_read()
183
 
 
184
 
    def unlock(self):
185
 
        self._branch.unlock()
186
 
 
187
174
 
188
175
class EmptyTree(Tree):
189
176
    def __init__(self):