/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/tree.py

Update a clean branch with the dirstate improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
    def lock_read(self):
224
224
        pass
225
225
 
 
226
    def revision_tree(self, revision_id):
 
227
        """Obtain a revision tree for the revision revision_id.
 
228
 
 
229
        The intention of this method is to allow access to possibly cached
 
230
        tree data. Implementors of this method should raise NoSuchRevision if
 
231
        the tree is not locally available, even if they could obtain the 
 
232
        tree via a repository or some other means. Callers are responsible 
 
233
        for finding the ultimate source for a revision tree.
 
234
 
 
235
        :param revision_id: The revision_id of the requested tree.
 
236
        :return: A Tree.
 
237
        :raises: NoSuchRevision if the tree cannot be obtained.
 
238
        """
 
239
        raise errors.NoSuchRevisionInTree(self, revision_id)
 
240
 
226
241
    def unknowns(self):
227
242
        """What files are present in this tree and unknown.
228
243
        
244
259
        pred = self.inventory.has_filename
245
260
        return set((p for p in paths if not pred(p)))
246
261
 
 
262
    def walkdirs(self, prefix=""):
 
263
        """Walk the contents of this tree from path down.
 
264
 
 
265
        This yields all the data about the contents of a directory at a time.
 
266
        After each directory has been yielded, if the caller has mutated the
 
267
        list to exclude some directories, they are then not descended into.
 
268
        
 
269
        The data yielded is of the form:
 
270
        ((directory-relpath, directory-path-from-root, directory-fileid),
 
271
        [(relpath, basename, kind, lstat, path_from_tree_root, file_id, 
 
272
          versioned_kind), ...]),
 
273
         - directory-relpath is the containing dirs relpath from prefix
 
274
         - directory-path-from-root is the containing dirs path from /
 
275
         - directory-fileid is the id of the directory if it is versioned.
 
276
         - relpath is the relative path within the subtree being walked.
 
277
         - basename is the basename
 
278
         - kind is the kind of the file now. If unknonwn then the file is not
 
279
           present within the tree - but it may be recorded as versioned. See
 
280
           versioned_kind.
 
281
         - lstat is the stat data *if* the file was statted.
 
282
         - path_from_tree_root is the path from the root of the tree.
 
283
         - file_id is the file_id is the entry is versioned.
 
284
         - versioned_kind is the kind of the file as last recorded in the 
 
285
           versioning system. If 'unknown' the file is not versioned.
 
286
        One of 'kind' and 'versioned_kind' must not be 'unknown'.
 
287
 
 
288
        :param prefix: Start walking from prefix within the tree rather than
 
289
        at the root. This allows one to walk a subtree but get paths that are
 
290
        relative to a tree rooted higher up.
 
291
        :return: an iterator over the directory data.
 
292
        """
 
293
        raise NotImplementedError(self.walkdirs)
 
294
 
247
295
 
248
296
class EmptyTree(Tree):
249
297