public static ConflictDescriptor createConflictDescription(SVNConflictDescription conflictDescription) {
if (conflictDescription == null){
return null;
}
SVNMergeFileSet mergeFiles = conflictDescription.getMergeFiles();
String basePath = null;
String repositoryPath = null;
try {
basePath = mergeFiles.getBasePath();
repositoryPath = mergeFiles.getRepositoryPath();
} catch (SVNException e) {
//
}
ConflictVersion left = null;
ConflictVersion right = null;
int op = 0;
if (conflictDescription.isTreeConflict()) {
SVNTreeConflictDescription tc = (SVNTreeConflictDescription) conflictDescription;
left = createConflictVersion(tc.getSourceLeftVersion());
right = createConflictVersion(tc.getSourceRightVersion());
op = getConflictOperation(tc.getOperation());
}
return new ConflictDescriptor(mergeFiles.getLocalPath(),
getConflictKind(conflictDescription.isPropertyConflict()),
getNodeKind(conflictDescription.getNodeKind()),
conflictDescription.getPropertyName(),
mergeFiles.isBinary(),
mergeFiles.getMimeType(),
getConflictAction(conflictDescription.getConflictAction()),
getConflictReason(conflictDescription.getConflictReason()),
op,
basePath,
repositoryPath,
mergeFiles.getWCPath(),
mergeFiles.getResultPath(),
left,
right
);
}