b.transform : module documentation

Part of bzrlib

No module docstring
Function unique_add Undocumented
Class TreeTransformBase The base class for TreeTransform and its kin.
Class DiskTreeTransform Tree transform storing its contents on disk.
Class OrphaningError Undocumented
Class OrphaningForbidden Undocumented
Function move_orphan See TreeTransformBase.new_orphan.
Function refuse_orphan See TreeTransformBase.new_orphan.
Class TreeTransform Represent a tree transformation.
Class TransformPreview A TreeTransform for generating preview trees.
Function joinpath Join tree-relative paths, handling the tree root specially
Class FinalPaths Make path calculation cheap by memoizing paths.
Function topology_sorted_ids Determine the topological order of the ids in a tree
Function build_tree Create working tree for a branch, using a TreeTransform.
Function resolve_checkout Undocumented
Function new_by_entry Create a new file according to its inventory entry
Function create_from_tree Create new file contents according to tree contents.
Function create_entry_executability Set the executability of a trans_id according to an inventory entry
Function get_backup_name Undocumented
Function revert Revert a working tree's contents to those of a target tree.
Function resolve_conflicts Make many conflict-resolution attempts, but die if they fail
Function conflict_pass Resolve some classes of conflicts.
Function cook_conflicts Generate a list of cooked conflicts, sorted by file path
Function iter_cook_conflicts Undocumented
Class _TransformResults Undocumented
Class _PreviewTree Partial implementation of Tree to support show_diff_trees
Function _build_tree See build_tree.
Function _create_files Undocumented
Function _reparent_children Undocumented
Function _reparent_transform_children Undocumented
Function _content_match Undocumented
Function _get_backup_name Produce a backup-style name that appears to be available
Function _prepare_revert_transform Undocumented
Function _alter_files Undocumented
Class _FileMover Moves and deletes files for TreeTransform, tracking operations
def unique_add(map, key, value):
Undocumented
def move_orphan(tt, orphan_id, parent_id):
See TreeTransformBase.new_orphan.

This creates a new orphan in the bzr-orphans dir at the root of the TreeTransform.

ParametersttThe TreeTransform orphaning trans_id.
orphan_idThe trans id that should be orphaned.
parent_idThe orphan parent trans id.
def refuse_orphan(tt, orphan_id, parent_id):
See TreeTransformBase.new_orphan.

This refuses to create orphan, letting the caller handle the conflict.

def joinpath(parent, child):
Join tree-relative paths, handling the tree root specially
def topology_sorted_ids(tree):
Determine the topological order of the ids in a tree
def build_tree(tree, wt, accelerator_tree=None, hardlink=False, delta_from_tree=False):

Create working tree for a branch, using a TreeTransform.

This function should be used on empty trees, having a tree root at most. (see merge and revert functionality for working with existing trees)

Existing files are handled like so:

  • Existing bzrdirs take precedence over creating new items. They are created as '%s.diverted' % name.
  • Otherwise, if the content on disk matches the content we are building, it is silently replaced.
  • Otherwise, conflict resolution will move the old file to 'oldname.moved'.
ParameterstreeThe tree to convert wt into a copy of
wtThe working tree that files will be placed into
accelerator_treeA tree which can be used for retrieving file contents more quickly than tree itself, i.e. a workingtree. tree will be used for cases where accelerator_tree's content is different.
hardlinkIf true, hard-link files to accelerator_tree, where possible. accelerator_tree must implement abspath, i.e. be a working tree.
delta_from_treeIf true, build_tree may use the input Tree to generate the inventory delta.
def _build_tree(tree, wt, accelerator_tree, hardlink, delta_from_tree):
See build_tree.
def _create_files(tt, tree, desired_files, pb, offset, accelerator_tree, hardlink):
Undocumented
def _reparent_children(tt, old_parent, new_parent):
Undocumented
def _reparent_transform_children(tt, old_parent, new_parent):
Undocumented
def _content_match(tree, entry, file_id, kind, target_path):
Undocumented
def resolve_checkout(tt, conflicts, divert):
Undocumented
def new_by_entry(tt, entry, parent_id, tree):
Create a new file according to its inventory entry
def create_from_tree(tt, trans_id, tree, file_id, bytes=None, filter_tree_path=None):
Create new file contents according to tree contents.
Parametersfilter_tree_paththe tree path to use to lookup content filters to apply to the bytes output in the working tree. This only applies if the working tree supports content filtering.
def create_entry_executability(tt, entry, trans_id):
Set the executability of a trans_id according to an inventory entry
@deprecated_function(deprecated_in((2, 3, 0)))
def get_backup_name(entry, by_parent, parent_trans_id, tt):
Undocumented
@deprecated_function(deprecated_in((2, 3, 0)))
def _get_backup_name(name, by_parent, parent_trans_id, tt):
Produce a backup-style name that appears to be available
def revert(working_tree, target_tree, filenames, backups=False, pb=None, change_reporter=None):
Revert a working tree's contents to those of a target tree.
def _prepare_revert_transform(working_tree, target_tree, tt, filenames, backups, pp, basis_tree=None, merge_modified=None):
Undocumented
def _alter_files(working_tree, target_tree, tt, pb, specific_files, backups, merge_modified, basis_tree=None):
Undocumented
def resolve_conflicts(tt, pb=None, pass_func=None):
Make many conflict-resolution attempts, but die if they fail
def conflict_pass(tt, conflicts, path_tree=None):
Resolve some classes of conflicts.
ParametersttThe transform to resolve conflicts in
conflictsThe conflicts to resolve
path_treeA Tree to get supplemental paths from
def cook_conflicts(raw_conflicts, tt):
Generate a list of cooked conflicts, sorted by file path
def iter_cook_conflicts(raw_conflicts, tt):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.