b.t.InventoryTree(Tree) : class documentation

Part of bzrlib.tree View In Hierarchy

Known subclasses: bzrlib.revisiontree.InventoryRevisionTree, bzrlib.transform._PreviewTree, bzrlib.workingtree_4.DirStateRevisionTree

A tree that relies on an inventory for its metadata.

Trees contain an Inventory object, and also know how to retrieve file texts mentioned in the inventory, either from a working directory or from a store.

It is possible for trees to contain files that are not described in their inventory or vice versa; for this use filenames().

Subclasses should set the _inventory attribute, which is considered private to external API users.

Method get_canonical_inventory_paths Like get_canonical_inventory_path() but works on multiple items.
Method get_canonical_inventory_path Returns the first inventory item that case-insensitively matches path.
Method path2id Return the id for path in this tree.
Method id2path Return the path for a file id.
Method has_id Undocumented
Method has_or_had_id Undocumented
Method all_file_ids Iterate through all file ids, including ids for missing files.
Method __iter__ Undocumented
Method filter_unversioned_files Filter out paths that are versioned.
Method iter_entries_by_dir Walk the tree in 'by_dir' order.
Method get_file_by_path Undocumented
Method _yield_canonical_inventory_paths Undocumented
Method _get_inventory 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_filename True if the tree has given filename.
Method __contains__ Undocumented
Method is_ignored Check whether the filename is ignored by this tree.
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_text Return the byte content of a file.
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 is_executable Check if a file is executable.
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 paths2ids Return all the ids that can be reached by walking from paths.
Method iter_children Undocumented
Method lock_read Lock this tree for multiple read only operations.
Method revision_tree Obtain a revision tree for the revision revision_id.
Method unknowns What files are present in this tree and unknown.
Method unlock Undocumented
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 get_canonical_inventory_paths(self, paths):
Like get_canonical_inventory_path() but works on multiple items.

:param paths: A sequence of paths relative to the root of the tree.
:return: A list of paths, with each item the corresponding input path
adjusted to account for existing elements that match case
insensitively.
def get_canonical_inventory_path(self, path):
Returns the first inventory item that case-insensitively matches path.

If a path matches exactly, it is returned. If no path matches exactly
but more than one path matches case-insensitively, it is implementation
defined which is returned.

If no path matches case-insensitively, the input path is returned, but
with as many path entries that do exist changed to their canonical
form.

If you need to resolve many names from the same tree, you should
use get_canonical_inventory_paths() to avoid O(N) behaviour.

:param path: A paths relative to the root of the tree.
:return: The input path adjusted to account for existing elements
that match case insensitively.
def _yield_canonical_inventory_paths(self, paths):
Undocumented
def _get_inventory(self):
Undocumented
@needs_read_lock
def path2id(self, path):
Return the id for path in this tree.
def id2path(self, file_id):
Return the path for a file id.
RaisesNoSuchId
def has_id(self, file_id):
Undocumented
def has_or_had_id(self, file_id):
Undocumented
def all_file_ids(self):
Iterate through all file ids, including ids for missing files.
@deprecated_method(deprecated_in((2, 4, 0)))
def __iter__(self):
Undocumented
def filter_unversioned_files(self, paths):
Filter out paths that are versioned.
Returnsset of paths.
@needs_read_lock
def iter_entries_by_dir(self, specific_file_ids=None, yield_parents=False):
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:

See Tree.iter_entries_by_dir for details.

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 get_file_by_path(self, path):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.