b.m.ConfigurableFileMerger(PerFileMerger) : class documentation

Part of bzrlib.merge View In Hierarchy

Known subclasses: bzrlib.plugins.changelog_merge.changelog_merge.ChangeLogMerger, bzrlib.plugins.news_merge.news_merge.NewsMerger

Merge individual files when configured via a .conf file.

This is a base class for concrete custom file merging logic. Concrete classes should implement merge_text.

See bzrlib.plugins.news_merge.news_merge for an example concrete class.

Instance Variablesaffected_filesThe configured file paths to merge.
Class Variablesname_prefixThe prefix to use when looking up configuration details. <name_prefix>_merge_files describes the files targeted by the hook for example.
default_filesThe default file paths to merge when no configuration is present.
Method __init__ Create a PerFileMerger for use with merger.
Method file_matches Check whether the file should call the merge hook.
Method merge_matching Merge the contents of a single file that has matched the criteria
Method merge_text Merge the byte contents of a single file.

Inherited from PerFileMerger:

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.
def __init__(self, merger):
Create a PerFileMerger for use with merger.
def file_matches(self, params):
Check whether the file should call the merge hook.

<name_prefix>_merge_files configuration variable is a list of files that should use the hook.

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.

def merge_text(self, params):
Merge the byte contents of a single file.

This is called after checking that the merge should be performed in merge_contents, and it should behave as per bzrlib.merge.AbstractPerFileMerger.merge_contents.

API Documentation for Bazaar, generated by pydoctor at 2019-07-18 00:29:27.