protected void deleteEntry(String path, SVNNodeKind nodeKind, SVNAdminArea dir) throws SVNException { SVNStatusType type = SVNStatusType.INAPPLICABLE; SVNEventAction action = SVNEventAction.SKIP; SVNEventAction expectedAction = SVNEventAction.UPDATE_DELETE; boolean[] isTreeConflicted = { false }; if (myAdminArea == null || dir != null) { if (nodeKind == SVNNodeKind.FILE) { SVNFileInfo file = new SVNFileInfo(path, false); file.loadFromRepository(myRevision1); String baseType = file.myBaseProperties.getStringValue(SVNProperty.MIME_TYPE); type = getDiffCallback().fileDeleted(path, file.myBaseFile, null, baseType, null, file.myBaseProperties, isTreeConflicted); } else if (nodeKind == SVNNodeKind.DIR) { type = getDiffCallback().directoryDeleted(path, isTreeConflicted); } if (type != SVNStatusType.MISSING && type != SVNStatusType.OBSTRUCTED && !isTreeConflicted[0]) { action = SVNEventAction.UPDATE_DELETE; if (myIsDryRun) { getDiffCallback().addDeletedPath(path); } } } action = isTreeConflicted[0] ? SVNEventAction.TREE_CONFLICT : action; addDeletedPath(path, nodeKind, type, action, expectedAction, isTreeConflicted[0]); }
private File getTempDirectory() throws SVNException { if (myTempDirectory == null) { myTempDirectory = getDiffCallback().createTempDirectory(); } return myTempDirectory; }
public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException { myCurrentDirectory = new SVNDirectoryInfo(myCurrentDirectory, path, true); myCurrentDirectory.myBaseProperties = Collections.EMPTY_MAP; SVNEventAction expectedAction = SVNEventAction.UPDATE_ADD; SVNEventAction action = expectedAction; SVNStatusType type = getDiffCallback().directoryAdded(path, myRevision2); if (myEventHandler != null) { if (type == SVNStatusType.MISSING || type == SVNStatusType.OBSTRUCTED) { action = SVNEventAction.SKIP; } // TODO prop type? SVNEvent event = SVNEventFactory.createMergeEvent(myAdminInfo, path, action, expectedAction, type, type, SVNNodeKind.DIR); myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN); } }
getDiffCallback().fileAdded(commitPath, null, reposFile, 0, myTargetRevision, null, reposMimeType, null, myCurrentFile.myPropertyDiff); } else { getDiffCallback().fileDeleted(commitPath, reposFile, null, reposMimeType, null, reposProperties); getDiffCallback().fileChanged(commitPath, myIsReverseDiff ? localFile : reposFile, myIsReverseDiff ? reposFile : localFile,
if (!getDiffCallback().isDiffCopiedAsAdded() && entry.isCopied()) { schedule = null; if (getDiffCallback().isDiffCopiedAsAdded() && entry.isCopied()) { propDiff = dir.getProperties(fileName).asMap(); } else { if (schedule != null && (entry.isScheduledForDeletion() || entry.isScheduledForReplacement())) { String mimeType = dir.getBaseProperties(fileName).getStringPropertyValue(SVNProperty.MIME_TYPE); getDiffCallback().fileDeleted(filePath, baseFile, null, mimeType, null, dir.getBaseProperties(fileName).asMap(), null); isAdded = entry.isScheduledForReplacement(); SVNProperties originalProperties = null; long revision = entry.getRevision(); if (entry.isCopied() && getDiffCallback().isDiffCopiedAsAdded()) { originalProperties = new SVNProperties(); revision = 0; originalProperties = dir.getBaseProperties(fileName).asMap(); getDiffCallback().fileAdded(filePath, null, tmpFile, 0, revision, mimeType, null, originalProperties, propDiff, null); } else if (schedule == null) { boolean modified = dir.hasTextModifications(fileName, false); String mimeType = dir.getProperties(fileName).getStringPropertyValue(SVNProperty.MIME_TYPE); getDiffCallback().fileChanged(filePath, modified ? baseFile : null, tmpFile, entry.getRevision(), -1, baseMimeType, mimeType, baseProps, propDiff, null);
getDiffCallback().clearDeletedPaths(); type = getDiffCallback().propertiesChanged(myCurrentDirectory.myRepositoryPath, myCurrentDirectory.myBaseProperties, myCurrentDirectory.myPropertyDiff, isTreeConflicted); if (isTreeConflicted[0]) { getDiffCallback().directoryClosed(myCurrentDirectory.myRepositoryPath, null);
SVNVersionedProperties baseProps = dir.getBaseProperties(dir.getThisDirName()); Map propDiff = baseProps.compareTo(dir.getProperties(dir.getThisDirName())).asMap(); getDiffCallback().propertiesChanged(info.myPath, baseProps.asMap(), propDiff); if (getDiffCallback().isDiffUnversioned()) { processedFiles = new HashSet(); if (getDiffCallback().isDiffUnversioned()) { diffUnversioned(dir.getRoot(), dir, anchor, processedFiles);
String mimeType = (String) myCurrentFile.myPropertyDiff.get(SVNProperty.MIME_TYPE); if (myCurrentFile.myIsAdded) { type = getDiffCallback().fileAdded(commitPath, myCurrentFile.myFile != null ? myCurrentFile.myBaseFile : null, myCurrentFile.myFile, 0, myRevision2, baseMimeType, mimeType, myCurrentFile.myBaseProperties, myCurrentFile.myPropertyDiff); } else { type = getDiffCallback().fileChanged(commitPath, myCurrentFile.myFile != null ? myCurrentFile.myBaseFile : null, myCurrentFile.myFile, myRevision1, myRevision2, baseMimeType, mimeType,
protected void delete() throws SVNException { SVNStatusType type = SVNStatusType.INAPPLICABLE; SVNEventAction action = SVNEventAction.SKIP; SVNEventAction expectedAction = SVNEventAction.UPDATE_DELETE; SVNFileInfoExt fileInfo = (SVNFileInfoExt) myCurrentFile; final SVNNodeKind nodeKind = fileInfo.getNodeKind(); SVNAdminArea dir = retrieveParent(myWCFile, true); if (myAdminArea == null || dir != null) { if (nodeKind == SVNNodeKind.FILE) { fileInfo.loadFromRepository(myRevision1); String baseType = fileInfo.myBaseProperties.getStringValue(SVNProperty.MIME_TYPE); SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: del " + myPath); type = getDiffCallback().fileDeleted(myPath, fileInfo.myBaseFile, null, baseType, null, fileInfo.myBaseProperties, null); } else if (nodeKind == SVNNodeKind.DIR) { SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: attempt to delete directory skipped"); } if (type != SVNStatusType.MISSING && type != SVNStatusType.OBSTRUCTED) { action = SVNEventAction.UPDATE_DELETE; if (myIsDryRun) { getDiffCallback().addDeletedPath(myPath); } } } addDeletedPath(myPath, nodeKind, type, action, expectedAction); }
String mimeType2 = SVNFileUtil.detectMimeType(file, null); String filePath = SVNPathUtil.append(parentRelativePath, file.getName()); getDiffCallback().fileAdded(filePath, null, file, 0, 0, mimeType1, mimeType2, null, null, null);
reversePropChanges(originalProps, diff); getDiffCallback().propertiesChanged(myCurrentDirectory.myPath, originalProps, diff); myCurrentDirectory.myComparedEntries.add("");
getDiffCallback().clearDeletedPaths(); type = getDiffCallback().propertiesChanged(myCurrentDirectory.myRepositoryPath, myCurrentDirectory.myBaseProperties, myCurrentDirectory.myPropertyDiff);
public void deleteEntry(String path, long revision) throws SVNException { File fullPath = new File(myAdminInfo.getAnchor().getRoot(), path); SVNAdminArea dir = myWCAccess.probeRetrieve(fullPath); SVNEntry entry = myWCAccess.getEntry(fullPath, false); if (entry == null) { return; } String name = SVNPathUtil.tail(path); myCurrentDirectory.myComparedEntries.add(name); if (!myIsCompareToBase && entry.isScheduledForDeletion()) { return; } if (entry.isFile()) { if (myIsReverseDiff) { File baseFile = dir.getBaseFile(name, false); SVNProperties baseProps = dir.getBaseProperties(name).asMap(); getDiffCallback().fileDeleted(path, baseFile, null, null, null, baseProps, null); } else { reportAddedFile(myCurrentDirectory, path, entry); } } else if (entry.isDirectory()) { SVNDirectoryInfo info = createDirInfo(myCurrentDirectory, path, false, SVNDepth.INFINITY); reportAddedDir(info); } }
getDiffCallback().fileAdded(commitPath, null, reposFile, 0, myTargetRevision, null, reposMimeType, null, myCurrentFile.myPropertyDiff, null); } else { getDiffCallback().fileDeleted(commitPath, reposFile, null, reposMimeType, null, reposProperties, null); getDiffCallback().fileChanged(commitPath, myIsReverseDiff ? localFile : reposFile, myIsReverseDiff ? reposFile : localFile,
if (!getDiffCallback().isDiffCopiedAsAdded() && entry.isCopied()) { schedule = null; if (getDiffCallback().isDiffCopiedAsAdded() && entry.isCopied()) { baseProps = new SVNProperties(); propDiff = dir.getProperties(fileName).asMap(); if (schedule != null && (entry.isScheduledForDeletion() || entry.isScheduledForReplacement())) { String mimeType = dir.getBaseProperties(fileName).getStringPropertyValue(SVNProperty.MIME_TYPE); getDiffCallback().fileDeleted(filePath, baseFile, null, mimeType, null, dir.getBaseProperties(fileName).asMap(), null); isAdded = entry.isScheduledForReplacement(); SVNProperties originalProperties = null; long revision = entry.getRevision(); if (entry.isCopied() && getDiffCallback().isDiffCopiedAsAdded()) { originalProperties = new SVNProperties(); revision = 0; originalProperties = dir.getBaseProperties(fileName).asMap(); getDiffCallback().fileAdded(filePath, null, tmpFile, 0, revision, mimeType, null, originalProperties, propDiff, null); } else if (schedule == null) { boolean modified = dir.hasTextModifications(fileName, false); String mimeType = dir.getProperties(fileName).getStringPropertyValue(SVNProperty.MIME_TYPE); getDiffCallback().fileChanged(filePath, modified ? baseFile : null, tmpFile, entry.getRevision(), -1, baseMimeType, mimeType, baseProps, propDiff, null);
getDiffCallback().clearDeletedPaths(); type = getDiffCallback().propertiesChanged(myCurrentDirectory.myRepositoryPath, myCurrentDirectory.myBaseProperties, myCurrentDirectory.myPropertyDiff, isTreeConflicted); if (isTreeConflicted[0]) { getDiffCallback().directoryClosed(myCurrentDirectory.myRepositoryPath, null);
SVNVersionedProperties baseProps = dir.getBaseProperties(dir.getThisDirName()); SVNProperties propDiff = baseProps.compareTo(dir.getProperties(dir.getThisDirName())).asMap(); getDiffCallback().propertiesChanged(info.myPath, baseProps.asMap(), propDiff, null); if (getDiffCallback().isDiffUnversioned()) { processedFiles = new SVNHashSet(); if (getDiffCallback().isDiffUnversioned()) { String relativePath = dir.getRelativePath(myAdminInfo.getAnchor()); diffUnversioned(dir.getRoot(), dir, relativePath, anchor, processedFiles);
String mimeType = propertyDiff.getStringValue(SVNProperty.MIME_TYPE); if (added) { type = getDiffCallback().fileAdded(commitPath, file != null ? baseFile : null, file, 0, myRevision2, baseMimeType, mimeType, baseProperties, propertyDiff, isTreeConflicted); } else { type = getDiffCallback().fileChanged(commitPath, file != null ? baseFile : null, file, myRevision1, myRevision2, baseMimeType, mimeType,
File baseFile = dir.getBaseFile(file.getName(), false); SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: del " + path); type = getDiffCallback().fileDeleted(path, baseFile, null, baseType, null, baseProperties.asMap(), null); } else if (nodeKind == SVNNodeKind.DIR) { SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: attempt to delete directory " + path + " skipped"); action = SVNEventAction.UPDATE_DELETE; if (myIsDryRun) { getDiffCallback().addDeletedPath(path);
String mimeType2 = SVNFileUtil.detectMimeType(file, null); String filePath = SVNPathUtil.append(parentRelativePath, file.getName()); getDiffCallback().fileAdded(filePath, null, file, 0, 0, mimeType1, mimeType2, null, null, null);