b.d.DiffTree(object) : class documentation

Part of bzrlib.diff View In Hierarchy

Provides textual representations of the difference between two trees.

A DiffTree examines two trees and where a file-id has altered between them, generates a textual representation of the difference. DiffTree uses a sequence of DiffPath objects which are each given the opportunity to handle a given altered fileid. The list of DiffPath objects can be extended globally by appending to DiffTree.diff_factories, or for a specific diff operation by supplying the extra_factories option to the appropriate method.

Method __init__ Constructor
Class Method from_trees_options Factory for producing a DiffTree.
Method show_diff Write tree diff to self.to_file
Method diff Perform a diff of a single file
Method _show_diff Undocumented
Method _diff Undocumented
def __init__(self, old_tree, new_tree, to_file, path_encoding='utf-8', diff_text=None, extra_factories=None):
Constructor
Parametersold_treeTree to show as old in the comparison
new_treeTree to show as new in the comparison
to_fileFile to write comparision to
path_encodingCharacter encoding to write paths in
diff_textDiffPath-type object to use as a last resort for diffing text files.
extra_factoriesFactories of DiffPaths to try before any other DiffPaths
@classmethod
def from_trees_options(klass, old_tree, new_tree, to_file, path_encoding, external_diff_options, old_label, new_label, using):
Factory for producing a DiffTree.

Designed to accept options used by show_diff_trees.

Parametersold_treeThe tree to show as old in the comparison
new_treeThe tree to show as new in the comparison
to_fileFile to write comparisons to
path_encodingCharacter encoding to use for writing paths
external_diff_optionsIf supplied, use the installed diff binary to perform file comparison, using supplied options.
old_labelPrefix to use for old file labels
new_labelPrefix to use for new file labels
usingCommandline to use to invoke an external diff tool
def show_diff(self, specific_files, extra_trees=None):
Write tree diff to self.to_file
Parametersspecific_filesthe specific files to compare (recursive)
extra_treesextra trees to use for mapping paths to file_ids
def _show_diff(self, specific_files, extra_trees):
Undocumented
def diff(self, file_id, old_path, new_path):
Perform a diff of a single file
Parametersfile_idfile-id of the file
old_pathThe path of the file in the old tree
new_pathThe path of the file in the new tree
def _diff(self, file_id, old_path, new_path, old_kind, new_kind):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.