com.microsoft.tfs.core.clients.versioncontrol.conflicts
Class VersionConflictDescription

java.lang.Object
  extended by com.microsoft.tfs.core.clients.versioncontrol.conflicts.ConflictDescription
      extended by com.microsoft.tfs.core.clients.versioncontrol.conflicts.VersionConflictDescription
Direct Known Subclasses:
DeletedConflictDescription, MergeConflictDescription, RollbackLocalConflictDescription, ShelvesetConflictDescription

public class VersionConflictDescription
extends ConflictDescription

This is a version conflict - the typical type of conflict, occuring when there have been both local and server changes to a file.

Since:
TEE-SDK-10.1

Constructor Summary
protected VersionConflictDescription(Workspace workspace, Conflict conflict, ItemSpec[] conflictItemSpecs)
           
 
Method Summary
 boolean analyzeConflict()
          Analyze the conflict for mergeability, etc.
 void clearAnalysis()
          Clears any data leftover from the analysis of this conflict.
protected  boolean filesRenamed()
           
protected  boolean filesRenamedOnly()
           
 java.lang.String getChangeDescription()
          Gets the change description.
 ConflictCategory getConflictCategory()
          Gets the category of this conflict
 java.lang.String getDescription()
          A long description of this conflict, suitable for display to the user.
 java.lang.String getName()
          A short description of the conflict, eg "Version Conflict"
 ConflictResolution[] getResolutions(ConflictResolutionContributor conflictResolutionContributor)
          Gets the resolution options for this particular conflict with the available merge toolset.
 boolean hasAnalyzed()
          Returns whether this conflict has been analyzed for mergeability.
protected  boolean isEncodingChange()
           
 boolean isResolutionEnabled(ConflictResolution resolution)
          Determines if a conflict resolution should be enabled (shown to the user.) We may know ahead of time that certain conflict resolutions (for example, AcceptMerge) are invalid (due to analyzing the conflict.)
 boolean showChangeDescription()
          The UI should attempt to show a change description (number of local/server/conflicting changes.)
protected  boolean targetRenamed()
          Exists only to be overridden by merge.
 
Methods inherited from class com.microsoft.tfs.core.clients.versioncontrol.conflicts.ConflictDescription
getConflict, getConflictItemSpecs, getLocalFileDescription, getLocalPath, getLocalPath, getRemoteFileDescription, getServerPath, getWorkspace, isBaseless, loadContributedResolutions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionConflictDescription

protected VersionConflictDescription(Workspace workspace,
                                     Conflict conflict,
                                     ItemSpec[] conflictItemSpecs)
Method Detail

getConflictCategory

public ConflictCategory getConflictCategory()
Gets the category of this conflict

Specified by:
getConflictCategory in class ConflictDescription
Returns:
A ConflictCategory for this conflict

getName

public java.lang.String getName()
A short description of the conflict, eg "Version Conflict"

Specified by:
getName in class ConflictDescription
Returns:
A String representing the short description of the conflict

getDescription

public java.lang.String getDescription()
A long description of this conflict, suitable for display to the user. eg ("You have a conflicting pending change.")

Specified by:
getDescription in class ConflictDescription
Returns:
A string representing the description of the conflict

showChangeDescription

public boolean showChangeDescription()
The UI should attempt to show a change description (number of local/server/conflicting changes.)

Overrides:
showChangeDescription in class ConflictDescription
Returns:
true to show change description, false otherwise

analyzeConflict

public boolean analyzeConflict()
Analyze the conflict for mergeability, etc. Running mergeEngine.countContentConflicts() will populate the conflict object's content conflict information. Analyze the conflict for mergeability, enablement, etc.

Overrides:
analyzeConflict in class ConflictDescription
Returns:
true if the conflict was analyzed, false if no changes were made

hasAnalyzed

public boolean hasAnalyzed()
Returns whether this conflict has been analyzed for mergeability.

Overrides:
hasAnalyzed in class ConflictDescription
Returns:

clearAnalysis

public void clearAnalysis()
Clears any data leftover from the analysis of this conflict.

Overrides:
clearAnalysis in class ConflictDescription

filesRenamed

protected boolean filesRenamed()

filesRenamedOnly

protected boolean filesRenamedOnly()

isEncodingChange

protected boolean isEncodingChange()

targetRenamed

protected boolean targetRenamed()
Exists only to be overridden by merge.

Returns:
true if the target was renamed

getChangeDescription

public java.lang.String getChangeDescription()
Gets the change description. Note that one should probably populate the conflict ContentMergeSummary before calling this for it to be useful. (See ConflictMergeSummaryCommand). Returns the "change description" - number of local/server/conflicting changes.

Overrides:
getChangeDescription in class ConflictDescription

getResolutions

public ConflictResolution[] getResolutions(ConflictResolutionContributor conflictResolutionContributor)
Gets the resolution options for this particular conflict with the available merge toolset. If the toolset is not null and contains a matching tool, external resolution options may be available.

Specified by:
getResolutions in class ConflictDescription
Parameters:
conflictResolutionContributor - an object which contributes resolutions for conflicts. May be null, but external resolution options won't be available.
Returns:
An array of ConflictResolutions for this particular conflict.

isResolutionEnabled

public boolean isResolutionEnabled(ConflictResolution resolution)
Determines if a conflict resolution should be enabled (shown to the user.) We may know ahead of time that certain conflict resolutions (for example, AcceptMerge) are invalid (due to analyzing the conflict.)

Overrides:
isResolutionEnabled in class ConflictDescription
Parameters:
resolution - The resolution to examine
Returns:
true if the resolution is enabled, false otherwise


© 2015 Microsoft. All rights reserved.