b.m.Merge3Merger(object) : class documentation

Part of bzrlib.merge View In Hierarchy

Known subclasses: bzrlib.merge.Diff3Merger, bzrlib.merge.MergeIntoMergeType, bzrlib.merge.WeaveMerger

Three-way merger that uses the merge3 text merger
Method __init__ Initialize the merger object and perform the merge.
Method do_merge Undocumented
Method make_preview_transform Undocumented
Method fix_root Undocumented
Method write_modified Undocumented
Static Method parent Determine the parent for a file_id (used as a key method)
Static Method name Determine the name for a file_id (used as a key method)
Static Method contents_sha1 Determine the sha1 of the file contents (used as a key method).
Static Method executable Determine the executability of a file-id (used as a key method).
Static Method kind Determine the kind of a file-id (used as a key method).
Static Method scalar_three_way Do a three-way test on a scalar.
Method merge_names Undocumented
Method merge_contents Fallback merge logic after user installed hooks.
Method get_lines Return the lines in a file, or an empty list.
Method text_merge Perform a three-way text merge on a file_id
Method merge_executable Perform a merge on the execute bit.
Method cook_conflicts Convert all conflicts into a form that doesn't depend on trans_id
Method _do_merge Undocumented
Method _make_preview_transform Undocumented
Method _compute_transform Undocumented
Method _finish_computing_transform Finalize the transform and report the changes.
Method _entries3 Gather data about files modified between three trees.
Method _entries_lca Gather data about files modified between multiple trees.
Static Method _three_way Undocumented
Static Method _lca_multi_way Consider LCAs when determining whether a change has occurred.
Method _merge_names Perform a merge on file_id names and parents
Method _do_merge_contents Performs a merge on file_id contents.
Method _default_other_winner_merge Replace this contents with other.
Method _get_filter_tree_path Undocumented
Method _dump_conflicts Emit conflict files.
Method _conflict_file Emit a single conflict file.
Method _merge_executable Perform a merge on the execute bit.
def __init__(self, working_tree, this_tree, base_tree, other_tree, interesting_ids=None, reprocess=False, show_base=False, pb=None, pp=None, change_reporter=None, interesting_files=None, do_merge=True, cherrypick=False, lca_trees=None, this_branch=None):
Initialize the merger object and perform the merge.
Parametersworking_treeThe working tree to apply the merge to
this_treeThe local tree in the merge operation
base_treeThe common tree in the merge operation
other_treeThe other tree to merge changes from
this_branchThe branch associated with this_tree. Defaults to this_tree.branch if not supplied.
interesting_idsThe file_ids of files that should be participate in the merge. May not be combined with interesting_files.
reprocess If True, perform conflict-reduction processing.
show_baseIf True, show the base revision in text conflicts. (incompatible with reprocess)
pbignored
ppA ProgressPhase object
change_reporterAn object that should report changes made
interesting_filesThe tree-relative paths of files that should participate in the merge. If these paths refer to directories, the contents of those directories will also be included. May not be combined with interesting_ids. If neither interesting_files nor interesting_ids is specified, all files may participate in the merge.
lca_treesCan be set to a dictionary of {revision_id:rev_tree} if the ancestry was found to include a criss-cross merge. Otherwise should be None.
def do_merge(self):
Undocumented
def _do_merge(self, operation):
Undocumented
def make_preview_transform(self):
Undocumented
def _make_preview_transform(self):
Undocumented
def _compute_transform(self):
Undocumented
def _finish_computing_transform(self):
Finalize the transform and report the changes.

This is the second half of _compute_transform.

def _entries3(self):
Gather data about files modified between three trees.

Return a list of tuples of file_id, changed, parents3, names3, executable3. changed is a boolean indicating whether the file contents or kind were changed. parents3 is a tuple of parent ids for base, other and this. names3 is a tuple of names for base, other and this. executable3 is a tuple of execute-bit values for base, other and this.

def _entries_lca(self):
Gather data about files modified between multiple trees.

This compares OTHER versus all LCA trees, and for interesting entries, it then compares with THIS and BASE.

For the multi-valued entries, the format will be (BASE, [lca1, lca2])

Returns

[(file_id, changed, parents, names, executable)], where:

  • file_id: Simple file_id of the entry

  • changed: Boolean, True if the kind or contents changed else False

  • parents: ((base, [parent_id, in, lcas]), parent_id_other,

    parent_id_this)

  • names: ((base, [name, in, lcas]), name_in_other, name_in_this)

  • executable: ((base, [exec, in, lcas]), exec_in_other,

    exec_in_this)

@deprecated_method(deprecated_in((2, 4, 0)))
def fix_root(self):
Undocumented
def write_modified(self, results):
Undocumented
@staticmethod
def parent(entry, file_id):
Determine the parent for a file_id (used as a key method)
@staticmethod
def name(entry, file_id):
Determine the name for a file_id (used as a key method)
@staticmethod
def contents_sha1(tree, file_id):
Determine the sha1 of the file contents (used as a key method).
@staticmethod
def executable(tree, file_id):
Determine the executability of a file-id (used as a key method).
@staticmethod
def kind(tree, file_id):
Determine the kind of a file-id (used as a key method).
@staticmethod
def _three_way(base, other, this):
Undocumented
@staticmethod
def _lca_multi_way(bases, other, this, allow_overriding_lca=True):
Consider LCAs when determining whether a change has occurred.

If LCAS are all identical, this is the same as a _three_way comparison.

Parametersbasesvalue in (BASE, [LCAS])
othervalue in OTHER
thisvalue in THIS
allow_overriding_lcaIf there is more than one unique lca value, allow OTHER to override THIS if it has a new value, and THIS only has an lca value, or vice versa. This is appropriate for truly scalar values, not as much for non-scalars.
Returns'this', 'other', or 'conflict' depending on whether an entry changed or not.
@staticmethod
@deprecated_method(deprecated_in((2, 2, 0)))
def scalar_three_way(this_tree, base_tree, other_tree, file_id, key):
Do a three-way test on a scalar. Return "this", "other" or "conflict", depending whether a value wins.
def merge_names(self, file_id):
Undocumented
def _merge_names(self, file_id, parents, names, resolver):
Perform a merge on file_id names and parents
def _do_merge_contents(self, file_id):
Performs a merge on file_id contents.
def _default_other_winner_merge(self, merge_hook_params):
Replace this contents with other.
def merge_contents(self, merge_hook_params):
Fallback merge logic after user installed hooks.
def get_lines(self, tree, file_id):
Return the lines in a file, or an empty list.
def text_merge(self, file_id, trans_id):
Perform a three-way text merge on a file_id
def _get_filter_tree_path(self, file_id):
Undocumented
def _dump_conflicts(self, name, parent_id, file_id, this_lines=None, base_lines=None, other_lines=None, set_version=False, no_base=False):
Emit conflict files. If this_lines, base_lines, or other_lines are omitted, they will be determined automatically. If set_version is true, the .OTHER, .THIS or .BASE (in that order) will be created as versioned files.
def _conflict_file(self, name, parent_id, tree, file_id, suffix, lines=None, filter_tree_path=None):
Emit a single conflict file.
def merge_executable(self, file_id, file_status):
Perform a merge on the execute bit.
def _merge_executable(self, file_id, executable, file_status, resolver):
Perform a merge on the execute bit.
def cook_conflicts(self, fs_conflicts):
Convert all conflicts into a form that doesn't depend on trans_id
API Documentation for Bazaar, generated by pydoctor at 2019-07-19 00:30:15.