b.b.b.BundleTree(Tree) : class documentation

Part of bzrlib.bundle.bundle_data View In Hierarchy

No class docstring
Method __init__ Undocumented
Method __str__ Undocumented
Method note_rename A file/directory has been renamed from old_path => new_path
Method note_id Files that don't exist in base need a new id.
Method note_last_changed Undocumented
Method note_patch There is a patch for a given filename.
Method note_target The symlink at the new path has the given target
Method note_deletion The file at old_path has been deleted.
Method note_executable Undocumented
Method old_path Get the old_path (path in the base_tree) for the file at new_path
Method new_path Get the new_path (path in the target_tree) for the file at old_path
Method path2id Return the id of the file present at path in the target tree.
Method id2path Return the new path in the target tree of the file with id file_id
Method old_contents_id Return the id in the base_tree for the given file_id.
Method get_file Return a file-like object containing the new contents of the
Method get_symlink_target Get the target for a given file_id.
Method get_kind Undocumented
Method is_executable Check if a file is executable.
Method get_last_changed Undocumented
Method get_size_and_sha1 Return the size and sha1 hash of the given file id.
Method __iter__ Undocumented
Method list_files List all files in this tree.
Method sorted_path_id Undocumented
Method _get_inventory Build up the inventory entry for the BundleTree.

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 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 iter_entries_by_dir Walk the tree in 'by_dir' order.
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_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 get_file_by_path Undocumented
Method iter_files_bytes Iterate through file contents.
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 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, base_tree, revision_id):
Undocumented
def __str__(self):
Undocumented
def note_rename(self, old_path, new_path):
A file/directory has been renamed from old_path => new_path
def note_id(self, new_id, new_path, kind='file'):
Files that don't exist in base need a new id.
def note_last_changed(self, file_id, revision_id):
Undocumented
def note_patch(self, new_path, patch):
There is a patch for a given filename.
def note_target(self, new_path, target):
The symlink at the new path has the given target
def note_deletion(self, old_path):
The file at old_path has been deleted.
def note_executable(self, new_path, executable):
Undocumented
def old_path(self, new_path):
Get the old_path (path in the base_tree) for the file at new_path
def new_path(self, old_path):
Get the new_path (path in the target_tree) for the file at old_path in the base tree.
def path2id(self, path):
Return the id of the file present at path in the target tree.
def id2path(self, file_id):
Return the new path in the target tree of the file with id file_id
def old_contents_id(self, file_id):
Return the id in the base_tree for the given file_id. Return None if the file did not exist in base.
def get_file(self, file_id):

Return a file-like object containing the new contents of the file given by file_id.

TODO: It might be nice if this actually generated an entry
in the text-store, so that the file contents would then be cached.
def get_symlink_target(self, file_id, path=None):
Get the target for a given file_id.

It is assumed that the caller already knows that file_id is referencing a symlink. :param file_id: Handle for the symlink entry. :param path: The path of the file. If both file_id and path are supplied, an implementation may use either one. :return: The path the symlink points to.

def get_kind(self, file_id):
Undocumented
def is_executable(self, file_id):
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 get_last_changed(self, file_id):
Undocumented
def get_size_and_sha1(self, file_id):
Return the size and sha1 hash of the given file id. If the file was not locally modified, this is extracted from the base_tree. Rather than re-reading the file.
def _get_inventory(self):
Build up the inventory entry for the BundleTree.

This need to be called before ever accessing self.inventory

def __iter__(self):
Undocumented
def list_files(self, include_root=False, from_dir=None, recursive=True):
List all files in this tree.
Parametersinclude_rootWhether to include the entry for the tree root
from_dirDirectory under which to list files
recursiveWhether to list files recursively
Returnsiterator over tuples of (path, versioned, kind, file_id, inventory entry)
def sorted_path_id(self):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2019-11-19 00:36:45.