protected SVNMergeResult handleMarkResolved(SVNMergeFileSet files, SVNMergeResult mergeResult) throws SVNException { if (!files.isBinary()) { // same as choose merged. return handleChooseMerged(files, mergeResult); } // same as choose working. return handleChooseWorking(files); }
protected SVNMergeResult handleMarkConflicted(SVNMergeFileSet files) throws SVNException { if (files.isBinary()) { return handleMarkBinaryConflicted(files); } return handleMarkTextConflicted(files); }
protected SVNMergeResult handleMarkConflicted(SVNMergeFileSet files) throws SVNException { if (files.isBinary()) { return handleMarkBinaryConflicted(files); } return handleMarkTextConflicted(files); }
protected SVNMergeResult handleMarkConflicted(SVNMergeFileSet files) throws SVNException { if (files.isBinary()) { return handleMarkBinaryConflicted(files); } return handleMarkTextConflicted(files); }
protected SVNMergeResult handleMarkResolved(SVNMergeFileSet files, SVNMergeResult mergeResult) throws SVNException { if (!files.isBinary()) { // same as choose merged. return handleChooseMerged(files, mergeResult); } // same as choose working. return handleChooseWorking(files); }
protected SVNMergeResult handleMarkResolved(SVNMergeFileSet files, SVNMergeResult mergeResult) throws SVNException { if (!files.isBinary()) { // same as choose merged. return handleChooseMerged(files, mergeResult); } // same as choose working. return handleChooseWorking(files); }
public SVNMergeResult mergeText(SVNMergeFileSet files, boolean dryRun, SVNDiffOptions options) throws SVNException { myDiffOptions = options; SVNStatusType status; if (files.isBinary()) { status = mergeBinary(files.getBaseFile(), files.getLocalFile(), files.getRepositoryFile(), options, files.getResultFile()); } else { status = mergeText(files.getBaseFile(), files.getLocalFile(), files.getRepositoryFile(), options, files.getResultFile()); } if (!files.isBinary() && status != SVNStatusType.CONFLICTED) { if (files.getCopyFromFile() != null) { status = SVNStatusType.MERGED; } else { SVNAdminArea adminArea = files.getAdminArea(); SVNVersionedProperties props = adminArea.getProperties(files.getWCPath()); boolean isSpecial = props.getPropertyValue(SVNProperty.SPECIAL) != null; // compare merge result with 'wcFile' (in case of text and no conflict). boolean isSameContents = SVNFileUtil.compareFiles(isSpecial ? files.getLocalFile() : files.getWCFile(), files.getResultFile(), null); status = isSameContents ? SVNStatusType.UNCHANGED : status; } } final SVNMergeResult result = SVNMergeResult.createMergeResult(status, null); if (dryRun) { return result; } return processMergedFiles(files, result); }
public SVNMergeResult mergeText(SVNMergeFileSet files, boolean dryRun, SVNDiffOptions options) throws SVNException { SVNStatusType status; if (files.isBinary()) { status = mergeBinary(files.getBaseFile(), files.getLocalFile(), files.getRepositoryFile(), options, files.getResultFile()); } else { status = mergeText(files.getBaseFile(), files.getLocalFile(), files.getRepositoryFile(), options, files.getResultFile()); } if (!files.isBinary() && status != SVNStatusType.CONFLICTED) { if (files.getCopyFromFile() != null) { status = SVNStatusType.MERGED; } else { SVNAdminArea adminArea = files.getAdminArea(); SVNVersionedProperties props = adminArea.getProperties(files.getWCPath()); boolean isSpecial = props.getPropertyValue(SVNProperty.SPECIAL) != null; // compare merge result with 'wcFile' (in case of text and no conflict). boolean isSameContents = SVNFileUtil.compareFiles(isSpecial ? files.getLocalFile() : files.getWCFile(), files.getResultFile(), null); status = isSameContents ? SVNStatusType.UNCHANGED : status; } } final SVNMergeResult result = SVNMergeResult.createMergeResult(status, null); if (dryRun) { return result; } return processMergedFiles(files, result); }
if (!files.isBinary() && !conflictDescription.isPropertyConflict()) { message += ",\n (mc) mine-conflict, (tc) theirs-conflict"; break; } else if ("mc".equals(answer)) { if (files.isBinary()) { mySVNEnvironment.getErr().println("Invalid option; cannot choose based on conflicts in a binary file."); mySVNEnvironment.getErr().println(); if (files.isBinary()) { mySVNEnvironment.getErr().println("Invalid option; cannot choose based on conflicts in a binary file."); mySVNEnvironment.getErr().println(); if (files.isBinary()) { mySVNEnvironment.getErr().println("Invalid option; cannot display conflicts for a binary file."); mySVNEnvironment.getErr().println();
if (!files.isBinary() && !conflictDescription.isPropertyConflict()) { message += ",\n (mc) mine-conflict, (tc) theirs-conflict"; break; } else if ("mc".equals(answer)) { if (files.isBinary()) { mySVNEnvironment.getErr().println("Invalid option; cannot choose based on conflicts in a binary file."); mySVNEnvironment.getErr().println(); if (files.isBinary()) { mySVNEnvironment.getErr().println("Invalid option; cannot choose based on conflicts in a binary file."); mySVNEnvironment.getErr().println(); if (files.isBinary()) { mySVNEnvironment.getErr().println("Invalid option; cannot display conflicts for a binary file."); mySVNEnvironment.getErr().println();
public SVNMergeResult mergeText(SVNMergeFileSet files, boolean dryRun, SVNDiffOptions options) throws SVNException { SVNStatusType status; if (files.isBinary()) { status = mergeBinary(files.getBaseFile(), files.getLocalFile(), files.getRepositoryFile(), options, files.getResultFile()); } else { status = mergeText(files.getBaseFile(), files.getLocalFile(), files.getRepositoryFile(), options, files.getResultFile()); } if (!files.isBinary() && status != SVNStatusType.CONFLICTED) { if (files.getCopyFromFile() != null) { status = SVNStatusType.MERGED; } else { SVNAdminArea adminArea = files.getAdminArea(); SVNVersionedProperties props = adminArea.getProperties(files.getWCPath()); boolean isSpecial = props.getPropertyValue(SVNProperty.SPECIAL) != null; // compare merge result with 'wcFile' (in case of text and no conflict). boolean isSameContents = SVNFileUtil.compareFiles(isSpecial ? files.getLocalFile() : files.getWCFile(), files.getResultFile(), null); status = isSameContents ? SVNStatusType.UNCHANGED : status; } } final SVNMergeResult result = SVNMergeResult.createMergeResult(status, null); if (dryRun) { return result; } return processMergedFiles(files, result); }
protected SVNMergeResult handleChooseMerged(SVNMergeFileSet files, SVNMergeResult mergeResult) throws SVNException { SVNProperties command = new SVNProperties(); SVNLog log = files.getLog(); if (mergeResult.getMergeStatus() != SVNStatusType.CONFLICTED) { // do normal merge. if (mergeResult.getMergeStatus() != SVNStatusType.UNCHANGED) { command.put(SVNLog.NAME_ATTR, files.getResultPath()); command.put(SVNLog.DEST_ATTR, files.getWCPath()); log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false); command.clear(); } return mergeResult; } else if (files.isBinary()) { // this action is not applicable for binary conflited files. return handleMarkConflicted(files); } else { // for text file we could use merged version in case of conflict. command.put(SVNLog.NAME_ATTR, files.getResultPath()); command.put(SVNLog.DEST_ATTR, files.getWCPath()); log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false); command.clear(); return SVNMergeResult.createMergeResult(SVNStatusType.MERGED, null); } }
protected SVNMergeResult handleChooseMerged(SVNMergeFileSet files, SVNMergeResult mergeResult) throws SVNException { SVNProperties command = new SVNProperties(); SVNLog log = files.getLog(); if (mergeResult.getMergeStatus() != SVNStatusType.CONFLICTED) { // do normal merge. if (mergeResult.getMergeStatus() != SVNStatusType.UNCHANGED) { if (log != null) { command.put(SVNLog.NAME_ATTR, files.getResultPath()); command.put(SVNLog.DEST_ATTR, files.getWCPath()); log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false); command.clear(); } } return mergeResult; } else if (files.isBinary()) { // this action is not applicable for binary conflited files. return handleMarkConflicted(files); } else { if (log != null) { // for text file we could use merged version in case of conflict. command.put(SVNLog.NAME_ATTR, files.getResultPath()); command.put(SVNLog.DEST_ATTR, files.getWCPath()); log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false); command.clear(); } return SVNMergeResult.createMergeResult(SVNStatusType.MERGED, null); } }
protected SVNMergeResult handleChooseMerged(SVNMergeFileSet files, SVNMergeResult mergeResult) throws SVNException { SVNProperties command = new SVNProperties(); SVNLog log = files.getLog(); if (mergeResult.getMergeStatus() != SVNStatusType.CONFLICTED) { // do normal merge. if (mergeResult.getMergeStatus() != SVNStatusType.UNCHANGED) { if (log != null) { command.put(SVNLog.NAME_ATTR, files.getResultPath()); command.put(SVNLog.DEST_ATTR, files.getWCPath()); log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false); command.clear(); } } return mergeResult; } else if (files.isBinary()) { // this action is not applicable for binary conflited files. return handleMarkConflicted(files); } else { if (log != null) { // for text file we could use merged version in case of conflict. command.put(SVNLog.NAME_ATTR, files.getResultPath()); command.put(SVNLog.DEST_ATTR, files.getWCPath()); log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false); command.clear(); } return SVNMergeResult.createMergeResult(SVNStatusType.MERGED, null); } }
getNodeKind(conflictDescription.getNodeKind()), conflictDescription.getPropertyName(), mergeFiles.isBinary(), mergeFiles.getMimeType(), getConflictAction(conflictDescription.getConflictAction()),
getNodeKind(conflictDescription.getNodeKind()), conflictDescription.getPropertyName(), mergeFiles.isBinary(), mergeFiles.getMimeType(), getConflictAction(conflictDescription.getConflictAction()),
getNodeKind(conflictDescription.getNodeKind()), conflictDescription.getPropertyName(), mergeFiles.isBinary(), mergeFiles.getMimeType(), getConflictAction(conflictDescription.getConflictAction()),
getNodeKind(conflictDescription.getNodeKind()), conflictDescription.getPropertyName(), mergeFiles.isBinary(), mergeFiles.getMimeType(), getConflictAction(conflictDescription.getConflictAction()),
private ConflictDescriptor getConflictDescription(SVNConflictDescription conflictDescription) throws ClientException { ConflictVersion srcLeft = null; ConflictVersion srcRight = null; ConflictDescriptor.Operation operation = Operation.none; if (conflictDescription instanceof SVNTreeConflictDescription) { SVNTreeConflictDescription treeConflictDescription = (SVNTreeConflictDescription) conflictDescription; srcLeft = getConflictVersion(treeConflictDescription.getSourceLeftVersion()); srcRight = getConflictVersion(treeConflictDescription.getSourceRightVersion()); operation = getConflictDescriptorOperation(treeConflictDescription.getOperation()); } return new ConflictDescriptor( getFilePath(conflictDescription.getPath()), getConflictDescriptorKind(conflictDescription), getNodeKind(conflictDescription.getNodeKind()), conflictDescription.getPropertyName(), conflictDescription.getMergeFiles().isBinary(), conflictDescription.getMergeFiles().getMimeType(), getConflictDescriptorAction(conflictDescription.getConflictAction()), getConflictDescriptorReason(conflictDescription.getConflictReason()), operation, getFilePath(conflictDescription.getMergeFiles().getBaseFile()), getFilePath(conflictDescription.getMergeFiles().getRepositoryFile()), getFilePath(conflictDescription.getMergeFiles().getLocalFile()), getFilePath(conflictDescription.getMergeFiles().getResultFile()), srcLeft, srcRight ); }