Part of bzrlib.merge View In Hierarchy
Known subclasses: bzrlib.merge._PlanLCAMerge, bzrlib.merge._PlanMerge
Method | __init__ | Contructor. |
Method | get_lines | Get lines for revisions from the backing VersionedFiles. |
Method | plan_merge | Generate a 'plan' for merging the two revisions. |
Method | _precache_tip_lines | Undocumented |
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. |
Parameters | a_rev | Revision-id of one revision to merge |
b_rev | Revision-id of the other revision to merge | |
vf | A VersionedFiles containing both revisions | |
key_prefix | A prefix for accessing keys in vf, typically (file_id,). |
Raises | RevisionNotPresent | on absent texts. |
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
See SequenceMatcher.get_matching_blocks
Returns | a tuple of (unique_left, unique_right), where the values are sets of line numbers of unique lines. |
It is assumed that the difference between the old_plan and new_plan is their choice of 'b' text.
All lines from new_plan that differ from old_plan are emitted verbatim. All lines from new_plan that match old_plan but are not about the 'b' revision are emitted verbatim.
Lines that match and are about the 'b' revision are the lines we don't want, so we convert 'killed-b' -> 'unchanged', and 'new-b' is skipped entirely.