b.f.ContentFilterTree(tree.Tree) : class documentation

Part of bzrlib.filter_tree View In Hierarchy

A virtual tree that applies content filters to an underlying tree.

Not every operation is supported yet.

Method __init__ Construct a new filtered tree view.
Method get_file_text Return the byte content of a file.
Method has_filename True if the tree has given filename.
Method is_executable Check if a file is executable.
Method iter_entries_by_dir Walk the tree in 'by_dir' order.
Method lock_read Lock this tree for multiple read only operations.
Method unlock Undocumented

Inherited from Tree:

Method has_versioned_directories Whether this tree can contain explicitly versioned directories.
Method changes_from Return a TreeDelta of the changes from other to this tree.
Method iter_changes See InterTree.iter_changes
Method conflicts Get a list of the conflicts in the tree.
Method extras For trees that can have unversioned files, return all such paths.
Method get_parent_ids Get the parent ids for this tree.
Method has_id Undocumented
Method __contains__ Undocumented
Method has_or_had_id Undocumented
Method is_ignored Check whether the filename is ignored by this tree.
Method all_file_ids Iterate through all file ids, including ids for missing files.
Method id2path Return the path for a file id.
Method list_files List all files in this tree.
Method iter_references Undocumented
Method kind Undocumented
Method stored_kind File kind stored for this file_id.
Method path_content_summary Get a summary of the information about path.
Method get_reference_revision Undocumented
Method get_file Return a file object for the file file_id in the tree.
Method get_file_with_stat Get a file handle and stat object for file_id.
Method get_file_lines Return the content of a file, as lines.
Method get_file_verifier Return a verifier for a file.
Method get_file_sha1 Return the SHA1 file for a file.
Method get_file_mtime Return the modification time for a file.
Method get_file_size Return the size of a file in bytes.
Method get_file_by_path Undocumented
Method iter_files_bytes Iterate through file contents.
Method get_symlink_target Get the target for a given file_id.
Method get_root_id Return the file_id for the root of this tree.
Method annotate_iter Return an iterator of revision_id, line tuples.
Method plan_file_merge Generate a merge plan based on annotations.
Method plan_file_lca_merge Generate a merge plan based lca-newness.
Method path2id Return the id for path in this tree.
Method paths2ids Return all the ids that can be reached by walking from paths.
Method iter_children Undocumented
Method revision_tree Obtain a revision tree for the revision revision_id.
Method unknowns What files are present in this tree and unknown.
Method filter_unversioned_files Filter out paths that are versioned.
Method walkdirs Walk the contents of this tree from path down.
Method supports_content_filtering Undocumented
Method iter_search_rules Find the preferences for filenames in a tree.
Method _comparison_data Return a tuple of kind, executable, stat_value for a file.
Method _file_size Undocumented
Method _get_plan_merge_data Undocumented
Method _iter_parent_trees Iterate through parent trees, defaulting to Tree.revision_tree.
Method _get_file_revision Ensure that file_id, tree_revision is in vf to plan the merge.
Method _check_retrieved Undocumented
Method _content_filter_stack The stack of content filters for a path if filtering is supported.
Method _content_filter_stack_provider A function that returns a stack of ContentFilters.
Method _get_rules_searcher Get the RulesSearcher for this tree given the default one.
def __init__(self, backing_tree, filter_stack_callback):
Construct a new filtered tree view.
Parametersfilter_stack_callbackA callable taking a path that returns the filter stack that should be used for that path.
backing_treeAn underlying tree to wrap.
def get_file_text(self, file_id, path=None):
Return the byte content of a file.

If both file_id and path are supplied, an implementation may use either one.

Parametersfile_idThe file_id of the file.
pathThe path of the file.
ReturnsA single byte string for the whole file.
def has_filename(self, filename):
True if the tree has given filename.
def is_executable(self, file_id, path=None):
Check if a file is executable.
Parametersfile_idThe handle for this file.
pathThe path that this file can be found at. These must point to the same object.
def iter_entries_by_dir(self, specific_file_ids=None, yield_parents=None):

Walk the tree in 'by_dir' order.

This will yield each entry in the tree as a (path, entry) tuple. The order that they are yielded is:

Directories are walked in a depth-first lexicographical order, however, whenever a directory is reached, all of its direct child nodes are yielded in lexicographical order before yielding the grandchildren.

For example, in the tree:

a/
  b/
    c
  d/
    e
f/
  g

The yield order (ignoring root) would be:

a, f, a/b, a/d, a/b/c, a/d/e, f/g
Parametersyield_parentsIf True, yield the parents from the root leading down to specific_file_ids that have been requested. This has no impact if specific_file_ids is None.
def lock_read(self):
Lock this tree for multiple read only operations.
ReturnsA bzrlib.lock.LogicalLockResult.
def unlock(self):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2019-07-19 00:30:15.