b.m.PerFileMerger(AbstractPerFileMerger) : class documentation

Part of bzrlib.merge View In Hierarchy

Known subclasses: bzrlib.merge.ConfigurableFileMerger

Merge individual files when self.file_matches returns True.

This class is intended to be subclassed. The file_matches and merge_matching methods should be overridden with concrete implementations.

Method file_matches Return True if merge_matching should be called on this file.
Method get_filename Lookup the filename (i.e. basename, not path), given a Tree (e.g.
Method get_filepath Calculate the path to the file in a tree.
Method merge_contents Merge the contents of a single file.
Method merge_matching Merge the contents of a single file that has matched the criteria

Inherited from AbstractPerFileMerger:

Method __init__ Create a PerFileMerger for use with merger.
def file_matches(self, params):
Return True if merge_matching should be called on this file.

Only called with merges of plain files with no clear winner.

Subclasses must override this.

def get_filename(self, params, tree):
Lookup the filename (i.e. basename, not path), given a Tree (e.g. self.merger.this_tree) and a MergeHookParams.
def get_filepath(self, params, tree):
Calculate the path to the file in a tree.
ParametersparamsA MergeHookParams describing the file to merge
treea Tree, e.g. self.merger.this_tree.
def merge_contents(self, params):
Merge the contents of a single file.
def merge_matching(self, params):
Merge the contents of a single file that has matched the criteria in PerFileMerger.merge_contents (is a conflict, is a file, self.file_matches is True).

Subclasses must override this.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.