com.starteam.viewcomparemerge
Class CustomThreeWayMergeAdapter

java.lang.Object
  extended by com.starteam.viewcomparemerge.FileMergeAdapter
      extended by com.starteam.viewcomparemerge.CustomThreeWayMergeAdapter

public class CustomThreeWayMergeAdapter
extends FileMergeAdapter

Facilitates the use of an external merge tool to resolve a Three-way file merge condition. For example:

 String app = "C:\\MyApp\\MyApp.exe";
 String commandline = "-s $source -t $target -a $ancestor -out $result";
 Note that each replaceable parameter (e.g. $source) must be separated from the next
 using the string separator ' \t', i.e. Blank space followed by TAB
 so for instance the example above needs to be annotated thus...
                                ...     -s \t$source \t -t \t $target \t ...
 FileMergeAdapter tool = new CustomThreeWayMergeAdapter(diff, app, commandline);
 int exitCode = tool.merge();
 if (exitCode == 0) {
        System.out.println("The merge was successful!");
 } else {
        System.out.println("MyApp failed with exit code: " + exitCode);
 }
 

See Also:
WorkstationDefaultMergeAdapter, StarTeamFileMergeAdapter, VisMergeAdapter, FileMergeAdapter

Field Summary
 
Fields inherited from class com.starteam.viewcomparemerge.FileMergeAdapter
PARAM_COMMON_ANCESTOR, PARAM_OUTPUT_FILE, PARAM_SOURCE_ANCESTOR, PARAM_SOURCE_FILE, PARAM_TARGET_ANCESTOR, PARAM_TARGET_FILE
 
Constructor Summary
CustomThreeWayMergeAdapter(ItemDifference diff, java.lang.String application, java.lang.String commandline)
          Constructs an adapter for resolving a given file merge condition.
 
Method Summary
 
Methods inherited from class com.starteam.viewcomparemerge.FileMergeAdapter
merge
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomThreeWayMergeAdapter

public CustomThreeWayMergeAdapter(ItemDifference diff,
                                  java.lang.String application,
                                  java.lang.String commandline)
Constructs an adapter for resolving a given file merge condition.

Parameters:
diff - The ItemDifference whose file merge condition is to be resolved.
application - The path to the external application to be run.
commandline - The paramaters to be passed to the application on the command line. May contain the special command-line symbols defined in FileMergeAdapter, which are expanded to file names before the application is executed.
See Also:
FileMergeAdapter.PARAM_SOURCE_FILE, FileMergeAdapter.PARAM_TARGET_FILE, FileMergeAdapter.PARAM_COMMON_ANCESTOR, FileMergeAdapter.PARAM_OUTPUT_FILE


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.