157
157
pred = self.inventory.has_filename
158
158
return set((p for p in paths if not pred(p)))
160
def walkdirs(self, prefix=""):
161
"""Walk the contents of this tree from path down.
163
This yields all the data about the contents of a directory at a time.
164
After each directory has been yielded, if the caller has mutated the
165
list to exclude some directories, they are then not descended into.
167
The data yielded is of the form:
168
[(relpath, basename, kind, lstat, path_from_tree_root, file_id,
169
versioned_kind), ...]
170
- relpath is the relative path within the subtree being walked.
171
- basename is the basename
172
- kind is the kind of the file now. If unknonwn then the file is not
173
present within the tree - but it may be recorded as versioned. See
175
- lstat is the stat data *if* the file was statted.
176
- path_from_tree_root is the path from the root of the tree.
177
- file_id is the file_id is the entry is versioned.
178
- versioned_kind is the kind of the file as last recorded in the
179
versioning system. If 'unknown' the file is not versioned.
180
One of 'kind' and 'versioned_kind' must not be 'unknown'.
182
:param prefix: Start walking from prefix within the tree rather than
183
at the root. This allows one to walk a subtree but get paths that are
184
relative to a tree rooted higher up.
185
:return: an iterator over the directory data.
187
raise NotImplementedError(self.walkdirs)
161
190
# for compatibility
162
191
from bzrlib.revisiontree import RevisionTree