protected SVNRemoteDiffEditor getMergeReportEditor(long defaultStart, long revision, SVNAdminArea adminArea, SVNDepth depth, AbstractDiffCallback mergeCallback, SVNRemoteDiffEditor editor) throws SVNException { if (editor == null) { editor = new SVNRemoteDiffEditor(adminArea, adminArea.getRoot(), mergeCallback, myRepository2, defaultStart, revision, myIsDryRun, this, this); } else { editor.reset(defaultStart, revision); } return editor; }
public void applyTextDelta(String commitPath, String baseChecksum) throws SVNException { SVNAdminArea dir = null; try { dir = retrieveParent(myCurrentFile.myWCFile, true); } catch (SVNException e) { dir = null; } myCurrentFile.myFile = createTempFile(dir, SVNPathUtil.tail(commitPath)); myDeltaProcessor.applyTextDelta(myCurrentFile.myBaseFile, myCurrentFile.myFile, false); }
protected File getTempDirectory() throws SVNException { if (myTempDirectory == null) { myTempDirectory = getDiffCallback().createTempDirectory(); } return myTempDirectory; }
public void deleteEntry(String path, long revision) throws SVNException { if (myCurrentDirectory.myIsSkip || myCurrentDirectory.myIsTreeConflicted) { return; } SVNNodeKind nodeKind = myRepos.checkPath(path, myRevision1); SVNAdminArea dir = retrieve(myCurrentDirectory.myWCFile, true); deleteEntry(path, nodeKind, dir); }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { myCurrentFile = createFileInfo(path, true); if (myCurrentDirectory.myIsSkip || myCurrentDirectory.myIsTreeConflicted) { myCurrentFile.myIsSkip = true; return; } myCurrentFile.myBaseProperties = new SVNProperties(); myCurrentFile.myBaseFile = SVNFileUtil.createUniqueFile(getTempDirectory(), ".diff", ".tmp", myIsUseGlobalTmp); }
SVNDiffCallback callback = new SVNDiffCallback(null, getDiffGenerator(), rev1, rev2, result); callback.setBasePath(basePath); editor = new SVNRemoteDiffEditor(null, null, callback, repository2, rev1, rev2, false, null, this); editor.setUseGlobalTmp(true); ISVNReporterBaton reporter = new ISVNReporterBaton() { } finally { if (editor != null) { editor.cleanup();
public void deleteEntry(String path, long revision) throws SVNException { SVNStatusType type = SVNStatusType.INAPPLICABLE; SVNEventAction action = SVNEventAction.SKIP; SVNEventAction expectedAction = SVNEventAction.UPDATE_DELETE; SVNNodeKind nodeKind = myRepos.checkPath(path, myRevision1); SVNAdminArea dir = retrieve(myCurrentDirectory.myWCFile, true); if (myAdminInfo == null || dir != null) { if (nodeKind == SVNNodeKind.FILE) { SVNFileInfo file = new SVNFileInfo(path, false); file.loadFromRepository(); String baseType = (String) file.myBaseProperties.get(SVNProperty.MIME_TYPE); type = getDiffCallback().fileDeleted(path, file.myBaseFile, null, baseType, null, file.myBaseProperties); } else if (nodeKind == SVNNodeKind.DIR) { type = getDiffCallback().directoryDeleted(path); } if (type != SVNStatusType.MISSING && type != SVNStatusType.OBSTRUCTED) { action = SVNEventAction.UPDATE_DELETE; if (myIsDryRun) { getDiffCallback().addDeletedPath(path); } } } if (myEventHandler != null) { SVNEvent event = SVNEventFactory.createMergeEvent(myAdminInfo, path, action, expectedAction, type, type, nodeKind); myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN); } }
retrieveParent(myCurrentFile.myWCFile, myIsDryRun); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { 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 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]); }
protected File createTempFile(SVNAdminArea dir, String name) throws SVNException { if (dir != null && dir.isLocked()) { File tmpFile = dir.getBaseFile(name, true); if (myTempFiles == null) { myTempFiles = new HashSet(); } myTempFiles.add(tmpFile); return tmpFile; } return SVNFileUtil.createUniqueFile(getTempDirectory(), name, ".tmp"); }
SVNRemoteDiffEditor editor = new SVNRemoteDiffEditor(info, info.getTarget().getRoot(), callback, repository2, rev1, rev2, dryRun, this, this); editor.cleanup();
protected SVNAdminArea retrieveParent(File path, boolean lenient) throws SVNException { if (myAdminArea == null) { return null; } return retrieve(path.getParentFile(), lenient); }
public void closeFile(String commitPath, String textChecksum) throws SVNException { if (myCurrentFile.myIsSkip) { return; } boolean[] isTreeConflicted = { false }; closeFile(commitPath, myCurrentFile.myIsAdded, myCurrentFile.myWCFile, myCurrentFile.myFile, myCurrentFile.myPropertyDiff, myCurrentFile.myBaseProperties, myCurrentFile.myBaseFile, isTreeConflicted); myCurrentFile.myIsTreeConflicted = isTreeConflicted[0]; }
public ISVNReusableEditor getMergeReportEditor(long defaultStart, long revision, SVNAdminArea adminArea, SVNDepth depth, AbstractDiffCallback mergeCallback, ISVNReusableEditor editor) throws SVNException { if (editor == null) { editor = new SVNRemoteDiffEditor(adminArea, adminArea.getRoot(), mergeCallback, myRepository2, defaultStart, revision, myIsDryRun, this, this); } else { editor.reset(defaultStart, revision); } return editor; }
public void openFile(String path, long revision) throws SVNException { myCurrentFile = createFileInfo(path, false); if (myCurrentDirectory.myIsSkip || myCurrentDirectory.myIsTreeConflicted) { myCurrentFile.myIsSkip = true; return; } myCurrentFile.loadFromRepository(revision); }
myRepository2.setLocation(oldURL, false); editor.cleanup();
protected void addDeletedPath(String path, SVNNodeKind nodeKind, SVNStatusType type, SVNEventAction action, SVNEventAction expectedAction) { if (myEventHandler != null) { File deletedFile = getFile(path); KindActionState kas = (KindActionState) myDeletedPaths.get(deletedFile); if (kas != null) { if (action == SVNEventAction.SKIP && (kas.myAction == SVNEventAction.UPDATE_DELETE || kas.myAction == SVNEventAction.SKIP)) { return; } } } super.addDeletedPath(path, nodeKind, type, action, expectedAction, false); }
SVNDiffCallback callback = new SVNDiffCallback(null, getDiffGenerator(), rev1, rev2, result); callback.setBasePath(basePath); editor = new SVNRemoteDiffEditor(null, null, callback, repository2, rev1, rev2, false, null, this); editor.setUseGlobalTmp(true); ISVNReporterBaton reporter = new ISVNReporterBaton() { public void report(ISVNReporter reporter) throws SVNException { } finally { if (editor != null) { editor.cleanup();
getDiffCallback().clearDeletedPaths(); if (!myCurrentDirectory.myPropertyDiff.isEmpty()) { try { dir = retrieve(myCurrentDirectory.myWCFile, myIsDryRun); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { type = getDiffCallback().propertiesChanged(myCurrentDirectory.myRepositoryPath, myCurrentDirectory.myBaseProperties, myCurrentDirectory.myPropertyDiff);
SVNStatusType[] type = {SVNStatusType.UNKNOWN, SVNStatusType.UNKNOWN}; try { retrieveParent(wcFile, myIsDryRun); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { 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,