b.t._PreviewTree(tree.InventoryTree) : class documentation

Part of bzrlib.transform View In Hierarchy

Partial implementation of Tree to support show_diff_trees
Method __init__ Undocumented
Method is_locked Undocumented
Method lock_read Lock this tree for multiple read only operations.
Method unlock Undocumented
Method inventory This Tree does not use inventory as its backing data.
Method get_root_id Return the file_id for the root of this tree.
Method all_file_ids Iterate through all file ids, including ids for missing files.
Method __iter__ Undocumented
Method has_id Undocumented
Method has_or_had_id Undocumented
Method path2id Return the id for path in this tree.
Method id2path Return the path for a file id.
Method iter_children Undocumented
Method extras For trees that can have unversioned files, return all such paths.
Method iter_entries_by_dir Walk the tree in 'by_dir' order.
Method list_files See WorkingTree.list_files.
Method kind Undocumented
Method stored_kind File kind stored for this file_id.
Method get_file_mtime See Tree.get_file_mtime
Method get_file_size See Tree.get_file_size
Method get_file_verifier Return a verifier for a file.
Method get_file_sha1 Return the SHA1 file for a file.
Method is_executable Check if a file is executable.
Method has_filename True if the tree has given filename.
Method path_content_summary Get a summary of the information about path.
Method iter_changes See InterTree.iter_changes.
Method get_file See Tree.get_file
Method get_file_with_stat Get a file handle and stat object for file_id.
Method annotate_iter Return an iterator of revision_id, line tuples.
Method get_symlink_target See Tree.get_symlink_target
Method walkdirs Walk the contents of this tree from path down.
Method get_parent_ids Get the parent ids for this tree.
Method set_parent_ids Undocumented
Method get_revision_tree Undocumented
Method _content_change Return True if the content of this file changed
Method _get_repository 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 _stat_limbo_file Undocumented
Method _by_parent Undocumented
Method _comparison_data Return a tuple of kind, executable, stat_value for a file.
Method _has_id Undocumented
Method _path2trans_id Undocumented
Method _all_children Undocumented
Method _make_inv_entries Undocumented
Method _list_files_by_dir Undocumented
Method _iter_entries_for_dir Return path, entry for items in a directory without recursing down.
Method _file_size Undocumented

Inherited from InventoryTree:

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 filter_unversioned_files Filter out paths that are versioned.
Method get_file_by_path Undocumented
Method _yield_canonical_inventory_paths Undocumented
Method _get_inventory Undocumented

Inherited from Tree (via InventoryTree):

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 conflicts Get a list of the conflicts in the tree.
Method __contains__ Undocumented
Method is_ignored Check whether the filename is ignored by this tree.
Method iter_references Undocumented
Method get_reference_revision Undocumented
Method get_file_text Return the byte content of a file.
Method get_file_lines Return the content of a file, as lines.
Method iter_files_bytes Iterate through file contents.
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 revision_tree Obtain a revision tree for the revision revision_id.
Method unknowns What files are present in this tree and unknown.
Method supports_content_filtering Undocumented
Method iter_search_rules Find the preferences for filenames in a tree.
Method _get_plan_merge_data Undocumented
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, transform):
Undocumented
def _content_change(self, file_id):
Return True if the content of this file changed
def _get_repository(self):
Undocumented
def _iter_parent_trees(self):
Iterate through parent trees, defaulting to Tree.revision_tree.
def _get_file_revision(self, file_id, vf, tree_revision):
Ensure that file_id, tree_revision is in vf to plan the merge.
def _stat_limbo_file(self, file_id=None, trans_id=None):
Undocumented
@property
def _by_parent(self):
Undocumented
def _comparison_data(self, entry, path):
Return a tuple of kind, executable, stat_value for a file.

entry may be None if there is no inventory entry for the file, but path must always be supplied.

kind is None if there is no file present (even if an inventory id is present). executable is False for non-file entries.

def is_locked(self):
Undocumented
def lock_read(self):
Lock this tree for multiple read only operations.
ReturnsA bzrlib.lock.LogicalLockResult.
def unlock(self):
Undocumented
@property
def inventory(self):
This Tree does not use inventory as its backing data.
def get_root_id(self):
Return the file_id for the root of this tree.
def all_file_ids(self):
Iterate through all file ids, including ids for missing files.
def __iter__(self):
Undocumented
def _has_id(self, file_id, fallback_check):
Undocumented
def has_id(self, file_id):
Undocumented
def has_or_had_id(self, file_id):
Undocumented
def _path2trans_id(self, path):
Undocumented
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 _all_children(self, trans_id):
Undocumented
def iter_children(self, file_id):
Undocumented
def extras(self):
For trees that can have unversioned files, return all such paths.
def _make_inv_entries(self, ordered_entries, specific_file_ids=None, yield_parents=False):
Undocumented
def _list_files_by_dir(self):
Undocumented
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 _iter_entries_for_dir(self, dir_path):
Return path, entry for items in a directory without recursing down.
def list_files(self, include_root=False, from_dir=None, recursive=True):
See WorkingTree.list_files.
def kind(self, file_id):
Undocumented
def stored_kind(self, file_id):
File kind stored for this file_id.

May not match kind on disk for working trees. Always available for versioned files, even when the file itself is missing.

def get_file_mtime(self, file_id, path=None):
See Tree.get_file_mtime
def _file_size(self, entry, stat_value):
Undocumented
def get_file_size(self, file_id):
See Tree.get_file_size
def get_file_verifier(self, file_id, path=None, stat_value=None):
Return a verifier for a file.

The default implementation returns a sha1.

Parametersfile_idThe handle for this file.
pathThe path that this file can be found at. These must point to the same object.
stat_valueOptional stat value for the object
ReturnsTuple with verifier name and verifier data
def get_file_sha1(self, file_id, path=None, stat_value=None):
Return the SHA1 file for a file.
Parametersfile_idThe handle for this file.
pathThe path that this file can be found at. These must point to the same object.
stat_valueOptional stat value for the object
Notecallers should use get_file_verifier instead where possible, as the underlying repository implementation may have quicker access to a non-sha1 verifier.
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 has_filename(self, path):
True if the tree has given filename.
def path_content_summary(self, path):
Get a summary of the information about path.

All the attributes returned are for the canonical form, not the
convenient form (if content filters are in use.)

:param path: A relative path within the tree.
:return: A tuple containing kind, size, exec, sha1-or-link.
    Kind is always present (see tree.kind()).
    size is present if kind is file and the size of the 
        canonical form can be cheaply determined, None otherwise.
    exec is None unless kind is file and the platform supports the 'x'
        bit.
    sha1-or-link is the link target if kind is symlink, or the sha1 if
        it can be obtained without reading the file.
def iter_changes(self, from_tree, include_unchanged=False, specific_files=None, pb=None, extra_trees=None, require_versioned=True, want_unversioned=False):
See InterTree.iter_changes.

This has a fast path that is only used when the from_tree matches the transform tree, and no fancy options are supplied.

def get_file(self, file_id, path=None):
See Tree.get_file
def get_file_with_stat(self, file_id, path=None):
Get a file handle and stat object for file_id.

The default implementation returns (self.get_file, None) for backwards compatibility.

Parametersfile_idThe file id to read.
pathThe path of the file, if it is known.
ReturnsA tuple (file_handle, stat_value_or_None). If the tree has no stat facility, or need for a stat cache feedback during commit, it may return None for the second element of the tuple.
def annotate_iter(self, file_id, default_revision=_mod_revision.CURRENT_REVISION):
Return an iterator of revision_id, line tuples.

For working trees (and mutable trees in general), the special
revision_id 'current:' will be used for lines that are new in this
tree, e.g. uncommitted changes.
:param file_id: The file to produce an annotated version from
:param default_revision: For lines that don't match a basis, mark them
    with this revision id. Not all implementations will make use of
    this value.
def get_symlink_target(self, file_id, path=None):
See Tree.get_symlink_target
def walkdirs(self, prefix=''):
Walk the contents of this tree from path down.

This yields all the data about the contents of a directory at a time.
After each directory has been yielded, if the caller has mutated the
list to exclude some directories, they are then not descended into.

The data yielded is of the form:
((directory-relpath, directory-path-from-root, directory-fileid),
[(relpath, basename, kind, lstat, path_from_tree_root, file_id,
  versioned_kind), ...]),
 - directory-relpath is the containing dirs relpath from prefix
 - directory-path-from-root is the containing dirs path from /
 - directory-fileid is the id of the directory if it is versioned.
 - relpath is the relative path within the subtree being walked.
 - basename is the basename
 - kind is the kind of the file now. If unknonwn then the file is not
   present within the tree - but it may be recorded as versioned. See
   versioned_kind.
 - lstat is the stat data *if* the file was statted.
 - path_from_tree_root is the path from the root of the tree.
 - file_id is the file_id if the entry is versioned.
 - versioned_kind is the kind of the file as last recorded in the
   versioning system. If 'unknown' the file is not versioned.
One of 'kind' and 'versioned_kind' must not be 'unknown'.

:param prefix: Start walking from prefix within the tree rather than
at the root. This allows one to walk a subtree but get paths that are
relative to a tree rooted higher up.
:return: an iterator over the directory data.
def get_parent_ids(self):
Get the parent ids for this tree.

:return: a list of parent ids. [] is returned to indicate
a tree with no parents.
:raises: BzrError if the parents are not known.
def set_parent_ids(self, parent_ids):
Undocumented
def get_revision_tree(self, revision_id):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2019-10-20 00:34:54.