Log In
or
Register
TWiki Web
Users
Groups
Index
Search
Changes
Notifications
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Main
Sandbox
TWiki
You are here:
FS
>
TWiki Web
>
TWikiMerge3DotPm
r1 - 17 Dec 2005 - 13:33 -
TWikiContributor
E
dit
A
ttach
P
rintable
Start of topic |
Skip to actions
---+ Package =TWiki::Merge= Support for 3-way merging of strings. Similar to Merge.pm, except that: a) it's considers the ancestor revision of the string, and b) it works. :-P %TOC% ---++ StaticMethod *merge* <tt>($a,$b,$c,$arev,$brev,$crev,$sep,</tt> $writeConflict, @info ) Perform a merge of two versions (b and c) of the same text, using HTML tags to mark conflicts. a is the common ancestor. The granularity of the merge depends on the setting of $sep. For example, if it is ="\\r?\\n"=, a line-by-line merge will be done. Where conflicts exist, they are labeled using the provided revision numbers. If a $writeConflict method is passed, then that's called to override the built-in conflict formatting. Non-conflicting content is not labeled. 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::Merge3::merge( $ancestorText, $prevText, $newText, $originalrev, $rev, "new", '\r?\n' );
End of topic
Skip to actions
|
Back to top
E
dit
|
A
ttach
|
P
rintable
|
R
aw view
|
Backlinks:
We
b
,
A
l
l webs
|
H
istory
: r1
|
M
ore topic actions
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding FS?
Send feedback