b.m.MemoryTree(mutabletree.MutableInventoryTree) : class documentation

Part of bzrlib.memorytree View In Hierarchy

A MemoryTree is a specialisation of MutableTree.

It maintains nearly no state outside of read_lock and write_lock transactions. (it keeps a reference to the branch, and its last-revision only).

Method __init__ Construct a MemoryTree for branch using revision_id.
Method is_control_filename True if filename is the name of a control file in this tree.
Method basis_tree See Tree.basis_tree().
Static Method create_on_branch Create a MemoryTree for branch, using the last-revision of branch.
Method get_file See Tree.get_file.
Method get_file_sha1 See Tree.get_file_sha1().
Method get_root_id Undocumented
Method rename_one Undocumented
Method path_content_summary See Tree.path_content_summary.
Method get_parent_ids See Tree.get_parent_ids.
Method has_filename See Tree.has_filename().
Method is_executable Undocumented
Method kind Undocumented
Method mkdir See MutableTree.mkdir().
Method last_revision See MutableTree.last_revision.
Method lock_read Lock the memory tree for reading.
Method lock_tree_write See MutableTree.lock_tree_write().
Method lock_write See MutableTree.lock_write().
Method put_file_bytes_non_atomic See MutableTree.put_file_bytes_non_atomic.
Method unlock Release a lock.
Method unversion Remove the file ids in file_ids from the current versioned set.
Method set_parent_ids See MutableTree.set_parent_trees().
Method set_parent_trees See MutableTree.set_parent_trees().
Method _add See MutableTree._add.
Method _gather_kinds See MutableTree._gather_kinds.
Method _comparison_data See Tree._comparison_data.
Method _file_size See Tree._file_size.
Method _populate_from_branch Populate the in-tree state from the branch.
Method _set_basis Undocumented

Inherited from MutableInventoryTree:

Method apply_inventory_delta Apply changes to the inventory as an atomic operation.
Method smart_add Version file_list, optionally recursing into directories.
Method update_basis_by_delta Update the parents of this tree after a commit.
Method _fix_case_of_inventory_path If our tree isn't case sensitive, return the canonical path

Inherited from MutableTree (via MutableInventoryTree):

Method add Add paths to the set of versioned paths.
Method add_reference Add a TreeReference to the tree, pointing at sub_tree
Method commit Undocumented
Method has_changes Quickly check that the tree contains at least one commitable change.
Method check_changed_or_out_of_date Check the tree for uncommitted changes and branch synchronization.
Method _add_reference Standard add_reference implementation, for use by subclasses
Method _observed_sha1 Tell the tree we have observed a paths sha1.
def __init__(self, branch, revision_id):
Construct a MemoryTree for branch using revision_id.
def is_control_filename(self, filename):
True if filename is the name of a control file in this tree.

This is true IF and ONLY IF the filename is part of the meta data that bzr controls in this tree. I.E. a random .bzr directory placed on disk will not be a control file for this tree.

ParametersfilenameA filename within the tree. This is a relative path from the root of this tree.
@needs_tree_write_lock
def _add(self, files, ids, kinds):
See MutableTree._add.
def basis_tree(self):
See Tree.basis_tree().
@staticmethod
def create_on_branch(branch):
Create a MemoryTree for branch, using the last-revision of branch.
def _gather_kinds(self, files, kinds):
See MutableTree._gather_kinds.

This implementation does not care about the file kind of missing files, so is a no-op.

def get_file(self, file_id, path=None):
See Tree.get_file.
def get_file_sha1(self, file_id, path=None, stat_value=None):
See Tree.get_file_sha1().
def get_root_id(self):
Undocumented
def _comparison_data(self, entry, path):
See Tree._comparison_data.
@needs_tree_write_lock
def rename_one(self, from_rel, to_rel):
Undocumented
def path_content_summary(self, path):
See Tree.path_content_summary.
def _file_size(self, entry, stat_value):
See Tree._file_size.
@needs_read_lock
def get_parent_ids(self):

See Tree.get_parent_ids.

This implementation returns the current cached value from
self._parent_ids.
def has_filename(self, filename):
See Tree.has_filename().
def is_executable(self, file_id, path=None):
Undocumented
def kind(self, file_id):
Undocumented
def mkdir(self, path, file_id=None):
See MutableTree.mkdir().
@needs_read_lock
def last_revision(self):
See MutableTree.last_revision.
def lock_read(self):
Lock the memory tree for reading.

This triggers population of data from the branch for its revision.

def lock_tree_write(self):
See MutableTree.lock_tree_write().
def lock_write(self):
See MutableTree.lock_write().
def _populate_from_branch(self):
Populate the in-tree state from the branch.
def put_file_bytes_non_atomic(self, file_id, bytes):
See MutableTree.put_file_bytes_non_atomic.
def unlock(self):
Release a lock.

This frees all cached state when the last lock context for the tree is left.

@needs_tree_write_lock
def unversion(self, file_ids):
Remove the file ids in file_ids from the current versioned set.

When a file_id is unversioned, all of its children are automatically unversioned.

Parametersfile_idsThe file ids to stop versioning.
RaisesNoSuchId if any fileid is not currently versioned.
def set_parent_ids(self, revision_ids, allow_leftmost_as_ghost=False):
See MutableTree.set_parent_trees().
def _set_basis(self):
Undocumented
def set_parent_trees(self, parents_list, allow_leftmost_as_ghost=False):
See MutableTree.set_parent_trees().
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.