public void handleEvent(SVNEvent event, double progress) { String path = event.getFile() == null ? event.getPath() : event.getFile().getAbsolutePath(); if (path != null) { path = path.replace(File.separatorChar, '/'); } if(myNotify != null && event.getErrorMessage() == null){ myNotify.onNotify( path, JavaHLObjectFactory.getNotifyActionValue(event.getAction()), JavaHLObjectFactory.getNodeKind(event.getNodeKind()), event.getMimeType(), JavaHLObjectFactory.getStatusValue(event.getContentsStatus()), JavaHLObjectFactory.getStatusValue(event.getPropertiesStatus()), event.getRevision() ); } if(myNotify2 != null){ NotifyInformation info = JavaHLObjectFactory.createNotifyInformation(event, path); myNotify2.onNotify(info); } }
private boolean isOperativeNotification(SVNEvent event) { return event.getContentsStatus() == SVNStatusType.CONFLICTED || event.getContentsStatus() == SVNStatusType.MERGED || event.getContentsStatus() == SVNStatusType.CHANGED || event.getPropertiesStatus() == SVNStatusType.CONFLICTED || event.getPropertiesStatus() == SVNStatusType.MERGED || event.getPropertiesStatus() == SVNStatusType.CHANGED || event.getAction() == SVNEventAction.UPDATE_ADD || event.getAction() == SVNEventAction.TREE_CONFLICT; }
public void handleEvent(SVNEvent event, double progress) throws SVNException { if (event.getFile().equals(mergedFile)) { return; } if (event.getAction() == SVNEventAction.DELETE) { event = SVNEventFactory.createMergeEvent(getAdminInfo(), event.getFile(), SVNEventAction.UPDATE_DELETE, SVNEventAction.UPDATE_DELETE, SVNStatusType.UNKNOWN, SVNStatusType.UNKNOWN, event.getNodeKind()); } oldEventHandler.handleEvent(event, progress); } };
public static NotifyInformation createNotifyInformation(SVNEvent event, String path) { // include full error message. String errMsg = null; if (event.getErrorMessage() != null) { errMsg = event.getErrorMessage().getFullMessage(); } return new NotifyInformation( path, JavaHLObjectFactory.getNotifyActionValue(event.getAction()), JavaHLObjectFactory.getNodeKind(event.getNodeKind()), event.getMimeType(), JavaHLObjectFactory.createLock(event.getLock()), errMsg, JavaHLObjectFactory.getStatusValue(event.getContentsStatus()), JavaHLObjectFactory.getStatusValue(event.getPropertiesStatus()), JavaHLObjectFactory.getLockStatusValue(event.getLockStatus()), event.getRevision() ); }
public void handleEvent(SVNEvent event, double progress) throws SVNException { File file = event.getFile(); String path = null; if (file != null) { if (event.getAction() == SVNEventAction.STATUS_EXTERNAL) { buffer.append("\nPerforming status on external item at '" + path + "'\n"); } else if (event.getAction() == SVNEventAction.STATUS_COMPLETED) { if (SVNRevision.isValidRevisionNumber(event.getRevision())) { String revStr = Long.toString(event.getRevision()); buffer.append("Status against revision: " + SVNFormatUtil.formatString(revStr, 6, false) + "\n"); } else if (event.getAction() == SVNEventAction.SKIP) { if (event.getErrorMessage() != null && event.getExpectedAction() == SVNEventAction.UPDATE_EXTERNAL) { myEnvironment.getErr().println(event.getErrorMessage()); if (event.getContentsStatus() == SVNStatusType.MISSING) { buffer.append("Skipped missing target: '" + path + "'\n"); } else if (path != null) { buffer.append("Skipped '" + path + "'\n"); } else if (event.getAction() == SVNEventAction.UPDATE_SKIP_OBSTRUCTION) { getConflictStats().incrementSkippedPaths(); buffer.append("Skipped '" + path + "' -- An obstructing working copy was found\n"); } else if (event.getAction() == SVNEventAction.UPDATE_SKIP_WORKING_ONLY) { getConflictStats().incrementSkippedPaths(); buffer.append("Skipped '" + path + "' -- Has no versioned parent\n"); } else if (event.getAction() == SVNEventAction.UPDATE_SKIP_ACCESS_DENINED) { getConflictStats().incrementSkippedPaths();
static ClientNotifyInformation getClientNotifyInformation(String pathPrefix, SVNEvent event, String path) { ClientNotifyInformation.Action action = getClientNotifyInformationAction(event.getAction()); if (action == null) { return null; int hunkFuzz = -1; Object info = event.getInfo(); if (info != null && info instanceof SVNPatchHunkInfo) { SVNPatchHunkInfo hunkInfo = (SVNPatchHunkInfo) info; getNodeKind(event.getNodeKind()), event.getMimeType(), getLock(event.getLock()), getErrorMessageString(event.getErrorMessage()), getClientNotifyInformationStatus(event.getContentsStatus()), getClientNotifyInformationStatus(event.getPropertiesStatus()), getClientNotifyInformationLockStatus(event.getLockStatus()), event.getRevision(), event.getChangelistName(), getRevisionRange(event.getMergeRange()), pathPrefix, event.getPropertyName(), getRevisionProperties(event.getRevisionProperties()), event.getPreviousRevision(), hunkOriginalStart, hunkOriginalLength,
public void handleEvent(SVNEvent event, double progress) throws SVNException { File file = event.getFile(); String path = null; if (file != null) { SVNEventAction action = event.getAction(); if (action == SVNEventAction.UPDATE_ADD) { pathChangeType = "A"; SVNStatusType contentsStatus = event.getContentsStatus(); if(contentsStatus== SVNStatusType.UNCHANGED) { pathChangeType = "D"; } else if (action == SVNEventAction.UPDATE_UPDATE) { SVNStatusType contentsStatus = event.getContentsStatus(); if (contentsStatus == SVNStatusType.CHANGED) { out.println("At revision " + event.getRevision()); return; } else if (action == SVNEventAction.ADD){ SVNStatusType propertiesStatus = event.getPropertiesStatus(); String propertiesChangeType = " "; if (propertiesStatus == SVNStatusType.CHANGED) { SVNStatusType lockType = event.getLockStatus(); if (lockType == SVNStatusType.LOCK_UNLOCKED) {
event.getAction() != SVNEventAction.UPDATE_DELETE, event.getFile()); if (newNearestAncestorIndex != myCurrentAncestorIndex) { MergePath child = (MergePath) childrenWithMergeInfoArray[newNearestAncestorIndex]; if (event.getContentsStatus() == SVNStatusType.MERGED || event.getContentsStatus() == SVNStatusType.CHANGED || event.getPropertiesStatus() == SVNStatusType.MERGED || event.getPropertiesStatus() == SVNStatusType.CHANGED || event.getAction() == SVNEventAction.UPDATE_ADD) { File mergedPath = event.getFile(); if (myMergedPaths == null) { myMergedPaths = new LinkedList(); if (event.getAction() == SVNEventAction.SKIP) { File skippedPath = event.getFile(); if (mySkippedPaths == null) { mySkippedPaths = new LinkedList(); } else if (event.getAction() == SVNEventAction.UPDATE_ADD) { boolean isRootOfAddedSubTree = false; File addedPath = event.getFile(); if (myAddedPaths == null) { isRootOfAddedSubTree = true;
SVNEventAction action = event.getAction(); logger.debug(action); updatedFiles.add(event.getFile().getName()); SVNStatusType contentsStatus = event.getContentsStatus(); if (contentsStatus == SVNStatusType.CHANGED) { updatedFiles.add(event.getFile().getName()); conflictFiles.add(event.getFile().getName()); updatedFiles.add(event.getFile().getName()); logger.debug("At revision " + event.getRevision());
public String toString() { StringBuffer sb = new StringBuffer(); if (getAction() != null) { sb.append(getAction().toString()); } if (getFile() != null) { if (sb.length() > 0) { sb.append(" "); } sb.append(getFile().toString()); } if (getURL() != null) { if (sb.length() > 0) { sb.append(" "); } sb.append(getURL().toString()); } return sb.toString(); }
ScmFileStatus status = SvnJavaUtil.getScmFileStatus( event.getExpectedAction() ); if ( event.getFile() == null || event.getExpectedAction() == SVNEventAction.COMMIT_DELTA_SENT || event.getExpectedAction() == SVNEventAction.COMMIT_COMPLETED || event.getNodeKind() != SVNNodeKind.FILE ) logger.info( "Unknown SVN file status: '" + event.getExpectedAction() + "' for file: " + event.getFile().getAbsolutePath() ); logger.debug( StringUtils.defaultString( status, event.getContentsStatus().toString() ) + " - " + event.getFile().getAbsolutePath() ); String currentFile = event.getFile().getAbsolutePath(); if ( currentFile.startsWith( baseDirectory.getAbsolutePath() ) )
public void handleEvent(SVNEvent event, double progress) throws SVNException { File file = event.getFile(); String path = null; if (file != null) { SVNEventAction action = event.getAction(); if (action == SVNEventAction.UPDATE_EXTERNAL) { SVNExternal ext = event.getExternalInfo(); if (ext == null) { } else { out.println(Messages.SubversionUpdateEventHandler_FetchExternal( ext.getResolvedURL(), ext.getRevision().getNumber(), event.getFile())); if (action == SVNEventAction.SKIP && event.getExpectedAction() == SVNEventAction.UPDATE_EXTERNAL && event.getNodeKind() == SVNNodeKind.FILE) {
@Override public void handleEvent(SVNEvent event, double progress) throws SVNException { SVNEventAction action = event.getAction(); if (action == SVNEventAction.UPDATE_EXTERNAL || action == SVNEventAction.UPDATE_COMPLETED) { File file = event.getFile(); SVNExternalDetails details = externalDetails.remove(file); if (details != null) { String path; try { path = getLocalPath(getRelativePath(file)); } catch (IOException e) { throw new SVNException(new RemotableSVNErrorMessage(SVNErrorCode.FS_GENERAL, e)); } out.println(Messages.SubversionUpdateEventHandler_FetchExternal(details.getUrl(), event.getRevision(), file)); externals.add(new External(modulePath + '/' + path, details.getUrl(), details.getRevision())); } } else if (action == SVNEventAction.FAILED_EXTERNAL) { File file = event.getFile(); SVNExternalDetails details = externalDetails.get(file); if (details != null) { out.println(Messages.SubversionUpdateEventHandler_FetchExternal(details.getUrl(), event.getRevision(), file) + " failed!"); } if (cancelProcessOnExternalsFailed) { throw new SVNException(new RemotableSVNErrorMessage(SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS, SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS.getDescription() + ": <" + file.getName() + ">")); } } super.handleEvent(event, progress); }
public void handleEvent(SVNEvent event, double progress) throws SVNException { if (event.getAction() == SVNEventAction.SKIP && event.getErrorMessage() != null) { return; } getEventListener().handleEvent(event, progress); } });
@Override public void handleEvent(SVNEvent event, double progress) throws SVNException { Assert.assertEquals(event.getExpectedAction(), event.getAction()); }
public void handleEvent(SVNEvent event, double progress) throws SVNException { if (event.getAction() == SVNEventAction.PROPERTY_DELETE_NONEXISTENT) { deletedNonExistent[0] = true; } else { printer.handleEvent(event, progress); } } public void checkCancelled() throws SVNCancelException {
public void handleEvent(SVNEvent event, double progress) throws SVNException { File path = event.getFile(); if (path != null) { path = SVNWCUtils.skipAncestor(dstPath, path); if (path != null) { path = new File(pair.dst, path.getPath()); event.setFile(path); } else if (dstPath.equals(event.getFile())) { event.setFile(pair.dst); } } if (oldHandler != null) { oldHandler.handleEvent(event, progress); } } });
/** * Gets the item's path relative to the Working Copy root directory. * * @return a string representation of the item's path */ public String getPath() { if (myPath != null) { return myPath; } if (myAdminAreaInfo == null && myRootFile == null) { return myName; } File file = getFile(); File root = myAdminAreaInfo != null ? myAdminAreaInfo.getAnchor().getRoot() : myRootFile; String rootPath = root.getAbsolutePath().replace(File.separatorChar, '/'); String filePath = file.getAbsolutePath().replace(File.separatorChar, '/'); myPath = filePath.substring(rootPath.length()); if (myPath.startsWith("/")) { myPath = myPath.substring(1); } return myPath; }
public static NotifyInformation createNotifyInformation(SVNEvent event, String path) { final int actionId = getNotifyActionValue(event.getAction()); if (actionId == -1) { return null; } // include full error message. String errMsg = null; if (event.getErrorMessage() != null) { errMsg = event.getErrorMessage().getFullMessage(); } // TODO 16 return new NotifyInformation( path, actionId, getNodeKind(event.getNodeKind()), event.getMimeType(), createLock(event.getLock()), errMsg, getStatusValue(event.getContentsStatus()), getStatusValue(event.getPropertiesStatus()), getLockStatusValue(event.getLockStatus()), event.getRevision(), event.getChangelistName(), createRevisionRange(event.getMergeRange()), "" ); }