b.t.DiskTreeTransform(TreeTransformBase) : class documentation

Part of bzrlib.transform View In Hierarchy

Known subclasses: bzrlib.transform.TransformPreview, bzrlib.transform.TreeTransform

Tree transform storing its contents on disk.
Method __init__ Constructor.
Method finalize Release the working tree lock, if held, clean up limbo dir.
Method adjust_path Change the path that is assigned to a transaction id.
Method create_file Schedule creation of a new file.
Method create_hardlink Schedule creation of a hard link
Method create_directory Schedule creation of a new directory.
Method create_symlink Schedule creation of a new symbolic link.
Method cancel_creation Cancel the creation of new file contents.
Method new_orphan Schedule an item to be orphaned.
Method _limbo_name Generate the limbo name of a file
Method _generate_limbo_path Generate a limbo path using the trans_id as the relative path.
Method _rename_in_limbo Fix limbo names so that the right final path is produced.
Method _limbo_descendants Return the set of trans_ids whose limbo paths descend from this.
Method _read_file_chunks Undocumented
Method _read_symlink_target Undocumented
Method _set_mtime All files that are created get the same mtime.

Inherited from TreeTransformBase:

Method __enter__ Support Context Manager API.
Method __exit__ Support Context Manager API.
Method create_path Assign a transaction id to a new path
Method adjust_root_path Emulate moving the root by moving all children, instead.
Method fixup_new_roots Reinterpret requests to change the root directory
Method trans_id_tree_file_id Determine the transaction id of a working tree file.
Method trans_id_file_id Determine or set the transaction id associated with a file ID.
Method trans_id_tree_path Determine (and maybe set) the transaction ID for a tree path.
Method get_tree_parent Determine id of the parent in the tree.
Method delete_contents Schedule the contents of a path entry for deletion
Method cancel_deletion Cancel a scheduled deletion
Method unversion_file Schedule a path entry to become unversioned
Method delete_versioned Delete and unversion a versioned file
Method set_executability Schedule setting of the 'execute' bit
Method set_tree_reference Set the reference associated with a directory
Method version_file Schedule a file to become versioned.
Method cancel_versioning Undo a previous versioning of a file
Method new_paths Determine the paths of all new and changed files.
Method final_kind Determine the final file kind, after any changes applied.
Method tree_file_id Determine the file id associated with the trans_id in the tree
Method final_file_id Determine the file id after any changes are applied, or None.
Method inactive_file_id Return the inactive file_id associated with a transaction id.
Method final_parent Determine the parent file_id, after any changes are applied.
Method final_name Determine the final filename, after all changes are applied.
Method by_parent Return a map of parent: children for known parents.
Method path_changed Return True if a trans_id's path has changed.
Method new_contents Undocumented
Method find_conflicts Find any violations of inventory or filesystem invariants
Method has_named_child Undocumented
Method new_file Convenience method to create files.
Method new_directory Convenience method to create directories.
Method new_symlink Convenience method to create symbolic link.
Method iter_changes Produce output in the same format as Tree.iter_changes.
Method get_preview_tree Return a tree representing the result of the transform.
Method commit Commit the result of this TreeTransform to a branch.
Method serialize Serialize this TreeTransform.
Method deserialize Deserialize a stored TreeTransform.
Method __get_root Undocumented
Method _assign_id Produce a new tranform id
Method _inventory_altered Determine which trans_ids need new Inventory entries.
Method _check_malformed Undocumented
Method _add_tree_children Add all the children of all active parents to the known paths.
Method _has_named_child Does a parent already have a name child.
Method _available_backup_name Find an available backup name.
Method _parent_loops No entry should be its own ancestor
Method _unversioned_parents If parent directories are versioned, children must be versioned.
Method _improper_versioning Cannot version a file with no contents, or a bad type.
Method _executability_conflicts Check for bad executability changes.
Method _overwrite_conflicts Check for overwrites (not permitted on Win32)
Method _duplicate_entries No directory may have two entries with the same name.
Method _duplicate_ids Each inventory id may only be used once
Method _parent_type_conflicts Children must have a directory parent
Method _set_executability Set the executability of versioned files
Method _new_entry Helper function to create a new filesystem entry.
Method _get_potential_orphans Find the potential orphans in a directory.
Method _affected_ids Return the set of transform ids affected by the transform
Method _get_file_id_maps Return mapping of file_ids to trans_ids in the to and from states
Method _from_file_data Get data about a file in the from (tree) state
Method _to_file_data Get data about a file in the to (target) state
Method _text_parent Undocumented
Method _get_parents_texts Get texts for compression parents of this file.
Method _get_parents_lines Get lines for compression parents of this file.
def __init__(self, tree, limbodir, pb=None, case_sensitive=True):
Constructor.
:param tree: The tree that will be transformed, but not necessarily
    the output tree.
:param limbodir: A directory where new files can be stored until
    they are installed in their proper places
:param pb: ignored
:param case_sensitive: If True, the target of the transform is
    case sensitive, not just case preserving.
def finalize(self):
Release the working tree lock, if held, clean up limbo dir.

This is required if apply has not been invoked, but can be invoked even after apply.

def _limbo_name(self, trans_id):
Generate the limbo name of a file
def _generate_limbo_path(self, trans_id):
Generate a limbo path using the trans_id as the relative path.

This is suitable as a fallback, and when the transform should not be sensitive to the path encoding of the limbo directory.

def adjust_path(self, name, parent, trans_id):
Change the path that is assigned to a transaction id.
def _rename_in_limbo(self, trans_ids):
Fix limbo names so that the right final path is produced.

This means we outsmarted ourselves-- we tried to avoid renaming these files later by creating them with their final names in their final parents. But now the previous name or parent is no longer suitable, so we have to rename them.

Even for trans_ids that have no new contents, we must remove their entries from _limbo_files, because they are now stale.

def _limbo_descendants(self, trans_id):
Return the set of trans_ids whose limbo paths descend from this.
def create_file(self, contents, trans_id, mode_id=None, sha1=None):
Schedule creation of a new file.
Parameterscontentsan iterator of strings, all of which will be written to the target destination.
trans_idTreeTransform handle
mode_idIf not None, force the mode of the target file to match the mode of the object referenced by mode_id. Otherwise, we will try to preserve mode bits of an existing file.
sha1If the sha1 of this content is already known, pass it in. We can use it to prevent future sha1 computations.
See Alsonew_file.
def _read_file_chunks(self, trans_id):
Undocumented
def _read_symlink_target(self, trans_id):
Undocumented
def _set_mtime(self, path):
All files that are created get the same mtime.

This time is set by the first object to be created.

def create_hardlink(self, path, trans_id):
Schedule creation of a hard link
def create_directory(self, trans_id):
Schedule creation of a new directory.

See also new_directory.

def create_symlink(self, target, trans_id):
Schedule creation of a new symbolic link.

target is a bytestring. See also new_symlink.

def cancel_creation(self, trans_id):
Cancel the creation of new file contents.
def new_orphan(self, trans_id, parent_id):
Schedule an item to be orphaned.

When a directory is about to be removed, its children, if they are not versioned are moved out of the way: they don't have a parent anymore.

Parameterstrans_idThe trans_id of the existing item.
parent_idThe parent trans_id of the item.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.