b.m._PlanMerge(_PlanMergeBase) : class documentation

Part of bzrlib.merge View In Hierarchy

Plan an annotate merge using on-the-fly annotation
Method __init__ Contructor.
Method plan_merge Generate a 'plan' for merging the two revisions.
Method _precache_tip_lines Undocumented
Method _find_recursive_lcas Find all the ancestors back to a unique lca
Method _find_unique_parents Find ancestors of tip that aren't ancestors of base.
Static Method _remove_external_references Remove references that go outside of the parent map.
Static Method _prune_tails Remove tails from the parent map.
Method _get_interesting_texts Return a dict of texts we are interested in.
Method _build_weave Undocumented

Inherited from _PlanMergeBase:

Method get_lines Get lines for revisions from the backing VersionedFiles.
Method _iter_plan Undocumented
Method _get_matching_blocks Return a description of which sections of two revisions match.
Method _unique_lines Analyse matching_blocks to determine which lines are unique
Static Method _subtract_plans Remove changes from new_plan that came from old_plan.
def __init__(self, a_rev, b_rev, vf, key_prefix):
Contructor.
Parametersa_revRevision-id of one revision to merge
b_revRevision-id of the other revision to merge
vfA VersionedFiles containing both revisions
key_prefixA prefix for accessing keys in vf, typically (file_id,).
def _precache_tip_lines(self):
Undocumented
def _find_recursive_lcas(self):
Find all the ancestors back to a unique lca
def _find_unique_parents(self, tip_keys, base_key):
Find ancestors of tip that aren't ancestors of base.
Parameterstip_keysNodes that are interesting
base_keyCull all ancestors of this node
ReturnsThe parent map for all revisions between tip_keys and base_key. base_key will be included. References to nodes outside of the ancestor set will also be removed.
@staticmethod
def _remove_external_references(parent_map):
Remove references that go outside of the parent map.
Parametersparent_mapSomething returned from Graph.get_parent_map(keys)
Returns(filtered_parent_map, child_map, tails) filtered_parent_map is parent_map without external references child_map is the {parent_key: [child_keys]} mapping tails is a list of nodes that do not have any parents in the map
@staticmethod
def _prune_tails(parent_map, child_map, tails_to_remove):
Remove tails from the parent map.

This will remove the supplied revisions until no more children have 0 parents.

Parametersparent_mapA dict of {child: [parents]}, this dictionary will be modified in place.
tails_to_removeA list of tips that should be removed, this list will be consumed
child_mapThe reverse dict of parent_map ({parent: [children]}) this dict will be modified
ReturnsNone, parent_map will be modified in place.
def _get_interesting_texts(self, parent_map):
Return a dict of texts we are interested in.

Note that the input is in key tuples, but the output is in plain revision ids.

Parametersparent_mapThe output from _find_recursive_lcas
ReturnsA dict of {'revision_id':lines} as returned by _PlanMergeBase.get_lines()
def _build_weave(self):
Undocumented
def plan_merge(self):
Generate a 'plan' for merging the two revisions.

This involves comparing their texts and determining the cause of differences. If text A has a line and text B does not, then either the line was added to text A, or it was deleted from B. Once the causes are combined, they are written out in the format described in VersionedFile.plan_merge

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