protected SVNMergeResult handleChooseConflicted(boolean chooseMine, SVNMergeFileSet files) throws SVNException { File tmpFile = SVNAdminUtil.createTmpFile(files.getAdminArea()); String separator = new String(getConflictSeparatorMarker()); String mineMarker = new String(getConflictStartMarker());
protected SVNMergeResult handleChooseConflicted(boolean chooseMine, SVNMergeFileSet files) throws SVNException { File tmpFile = SVNAdminUtil.createTmpFile(files.getAdminArea()); String separator = new String(getConflictSeparatorMarker()); String mineMarker = new String(getConflictStartMarker());
protected void makeBinaryConflictEntry(SVNMergeFileSet files, String newFilePath, String oldFilePath) throws SVNException { SVNProperties command = new SVNProperties(); SVNLog log = files.getLog(); command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_NEW), newFilePath); command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_OLD), oldFilePath); log.logChangedEntryProperties(files.getWCPath(), command); command.clear(); files.getAdminArea().saveEntries(false); }
protected void makeBinaryConflictEntry(SVNMergeFileSet files, String newFilePath, String oldFilePath) throws SVNException { SVNProperties command = new SVNProperties(); SVNLog log = files.getLog(); if (log != null) { command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_NEW), newFilePath); command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_OLD), oldFilePath); log.logChangedEntryProperties(files.getWCPath(), command); command.clear(); } files.getAdminArea().saveEntries(false); }
protected void makeBinaryConflictEntry(SVNMergeFileSet files, String newFilePath, String oldFilePath) throws SVNException { SVNProperties command = new SVNProperties(); SVNLog log = files.getLog(); if (log != null) { command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_NEW), newFilePath); command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_OLD), oldFilePath); log.logChangedEntryProperties(files.getWCPath(), command); command.clear(); } files.getAdminArea().saveEntries(false); }
protected SVNMergeResult handleChooseConflicted(boolean chooseMine, SVNMergeFileSet files) throws SVNException { File tmpFile = SVNAdminUtil.createTmpFile(files.getAdminArea()); setDiffConflictStyle(chooseMine ? SVNDiffConflictChoiceStyle.CHOOSE_MODIFIED : SVNDiffConflictChoiceStyle.CHOOSE_LATEST); File leftFile = files.getBaseFile(); File rightFile = files.getRepositoryFile(); File detranslatedTarget = files.getLocalFile(); mergeText(leftFile, detranslatedTarget, rightFile, getDiffOptions(), tmpFile); SVNLog log = files.getLog(); if (log != null) { SVNProperties command = new SVNProperties(); String tmpBasePath = SVNFileUtil.getBasePath(tmpFile); command.put(SVNLog.NAME_ATTR, tmpBasePath); command.put(SVNLog.DEST_ATTR, files.getWCPath()); log.addCommand(SVNLog.COPY_AND_TRANSLATE, command, false); command.clear(); command.put(SVNLog.NAME_ATTR, tmpBasePath); log.addCommand(SVNLog.DELETE, command, false); command.clear(); } return SVNMergeResult.createMergeResult(SVNStatusType.MERGED, null); }
protected SVNMergeResult handleMarkBinaryConflicted(SVNMergeFileSet files) throws SVNException { SVNProperties command = new SVNProperties(); File root = files.getAdminArea().getRoot(); SVNLog log = files.getLog(); File oldFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getBaseLabel(), false); File newFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getRepositoryLabel(), false); SVNFileUtil.copyFile(files.getBaseFile(), oldFile, false); SVNFileUtil.copyFile(files.getRepositoryFile(), newFile, false); if (!files.getLocalPath().equals(files.getWCPath())) { File mineFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getLocalLabel(), false); String minePath = SVNFileUtil.getBasePath(mineFile); if (log != null) { command.put(SVNLog.NAME_ATTR, files.getLocalPath()); command.put(SVNLog.DEST_ATTR, minePath); log.addCommand(SVNLog.MOVE, command, false); command.clear(); } command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), minePath); } else { command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), ""); } String newPath = SVNFileUtil.getBasePath(newFile); String oldPath = SVNFileUtil.getBasePath(oldFile); makeBinaryConflictEntry(files, newPath, oldPath); return SVNMergeResult.createMergeResult(SVNStatusType.CONFLICTED, null); }
protected SVNMergeResult handleMarkBinaryConflicted(SVNMergeFileSet files) throws SVNException { SVNProperties command = new SVNProperties(); File root = files.getAdminArea().getRoot(); SVNLog log = files.getLog(); File oldFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getBaseLabel(), false); File newFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getRepositoryLabel(), false); SVNFileUtil.copyFile(files.getBaseFile(), oldFile, false); SVNFileUtil.copyFile(files.getRepositoryFile(), newFile, false); if (!files.getLocalPath().equals(files.getWCPath())) { File mineFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getLocalLabel(), false); String minePath = SVNFileUtil.getBasePath(mineFile); if (log != null) { command.put(SVNLog.NAME_ATTR, files.getLocalPath()); command.put(SVNLog.DEST_ATTR, minePath); log.addCommand(SVNLog.MOVE, command, false); command.clear(); } command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), minePath); } else { command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), ""); } String newPath = SVNFileUtil.getBasePath(newFile); String oldPath = SVNFileUtil.getBasePath(oldFile); makeBinaryConflictEntry(files, newPath, oldPath); return SVNMergeResult.createMergeResult(SVNStatusType.CONFLICTED, null); }
protected SVNMergeResult handleMarkBinaryConflicted(SVNMergeFileSet files) throws SVNException { SVNProperties command = new SVNProperties(); File root = files.getAdminArea().getRoot(); SVNLog log = files.getLog(); File oldFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getBaseLabel(), false); File newFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getRepositoryLabel(), false); SVNFileUtil.copyFile(files.getBaseFile(), oldFile, false); SVNFileUtil.copyFile(files.getRepositoryFile(), newFile, false); if (!files.getLocalPath().equals(files.getWCPath())) { File mineFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getLocalLabel(), false); String minePath = SVNFileUtil.getBasePath(mineFile); command.put(SVNLog.NAME_ATTR, files.getLocalPath()); command.put(SVNLog.DEST_ATTR, minePath); log.addCommand(SVNLog.MOVE, command, false); command.clear(); command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), minePath); } else { command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), ""); } String newPath = SVNFileUtil.getBasePath(newFile); String oldPath = SVNFileUtil.getBasePath(oldFile); makeBinaryConflictEntry(files, newPath, oldPath); return SVNMergeResult.createMergeResult(SVNStatusType.CONFLICTED, null); }
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); }
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 handleMarkTextConflicted(SVNMergeFileSet files) throws SVNException { SVNProperties command = new SVNProperties(); File root = files.getAdminArea().getRoot(); SVNLog log = files.getLog(); File tmpTargetCopy = SVNTranslator.getTranslatedFile(files.getAdminArea(), files.getWCPath(), files.getWCFile(), false, false, false, true); String tmpTargetCopyPath = SVNFileUtil.getBasePath(tmpTargetCopy);
protected SVNMergeResult handleMarkTextConflicted(SVNMergeFileSet files) throws SVNException { SVNProperties command = new SVNProperties(); File root = files.getAdminArea().getRoot(); SVNLog log = files.getLog(); command.clear(); File tmpTargetCopy = SVNTranslator.getTranslatedFile(files.getAdminArea(), files.getWCPath(), files.getWCFile(), false, false, false, true); String tmpTargetCopyPath = SVNFileUtil.getBasePath(tmpTargetCopy);
protected SVNMergeResult handleMarkTextConflicted(SVNMergeFileSet files) throws SVNException { SVNProperties command = new SVNProperties(); File root = files.getAdminArea().getRoot(); SVNLog log = files.getLog(); File tmpTargetCopy = SVNTranslator.getTranslatedFile(files.getAdminArea(), files.getWCPath(), files.getWCFile(), false, false, false, true); String tmpTargetCopyPath = SVNFileUtil.getBasePath(tmpTargetCopy);