Line: 5 to 5 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < | StaticMethod insDelMerge ($a,$b,$sep,$session,$info) | |||||||
> > | StaticMethod merge2 ($arev,$a,$brev,$b,$sep,$session,$info)
| |||||||
Perform a merge of two versions of the same text, using HTML tags to mark conflicts. | ||||||||
Line: 20 to 27 | ||||||||
Non-conflicting content (insertions from either set) are not marked. | ||||||||
Changed: | ||||||||
< < | The plugins mergeHandler is called for each merge. | |||||||
> > | The plugins mergeHandler is called for each merge.
Call it like this:
$newText = TWiki::Merge::merge2( $oldrev, $old, $newrev, $new, '.*?\n', $session, $info ); | |||||||
StaticMethod simpleMerge ($a,$b,$sep) -> \@arrPerform a merge of two versions of the same text, returning | ||||||||
Changed: | ||||||||
< < | and array of strings representing the blocks in the merged context | |||||||
> > | an array of strings representing the blocks in the merged context | |||||||
where each string starts with one of "+", "-" or " " depending on whether it is an insertion, a deletion, or just text. Insertions and deletions alway happen in pairs, as text taken in from either | ||||||||
Line: 39 to 52 | ||||||||
$sep characters are retained in the outout. | ||||||||
Added: | ||||||||
> > |
StaticMethod merge3 ($arev,$a,$brev,$b,$crev,$c,$sep,$session, $info )
".*?\\n" , a line-by-line merge will be done.
Where conflicts exist, they are labeled using the provided revision
numbers.
The plugins mergeHandler is called for each merge.
Here's a little picture of a 3-way merge:
a <- ancestor
/ b c <- revisions
\ /
d <- merged result, returned.
call it like this:
my ( $ancestorMeta, $ancestorText ) = $store->readTopic( undef, $webName, $topic, $originalrev ); $newText = TWiki::Merge::merge3( $ancestorText, $prevText, $newText, $originalrev, $rev, "new", '.*?\n' ); |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > | Package
Support for merging strings
|