Examples of SVNEvent


Examples of org.tmatesoft.svn.core.wc.SVNEvent

            SVNFileUtil.deleteFile(new File(childDir, SVNFileUtil.getAdminDirectoryName() + "/lock"));
        }
        SVNAdminArea childArea = myWCAccess.open(childDir, true, 0);
        myWCAccess.registerCleanupHandler(childArea, myCurrentDirectory);
        if (!myCurrentDirectory.isAddExisted) {
            SVNEvent event = SVNEventFactory.createSVNEvent(parentArea.getFile(entry.getName()),
                    SVNNodeKind.DIR, null, myTargetRevision, myCurrentDirectory.isExisted ?
                            SVNEventAction.UPDATE_EXISTS : SVNEventAction.UPDATE_ADD, null, null, null);
            event.setPreviousRevision(myCurrentDirectory.myPreviousRevision);
            event.setPreviousURL(entry.getSVNURL());
            event.setURL(myCurrentDirectory.URL != null ? SVNURL.parseURIEncoded(myCurrentDirectory.URL) : null);
            myWCAccess.handleEvent(event);
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

            boolean hasPropConflicts = adminArea.hasPropConflict(adminArea.getThisDirName());
            if (hasPropConflicts) {
                myCurrentDirectory.isSkipped = true;
                Collection skippedPaths = getSkippedPaths();
                skippedPaths.add(adminArea.getRoot());
                SVNEvent event = SVNEventFactory.createSVNEvent(adminArea.getRoot(), SVNNodeKind.DIR, null,
                        myTargetRevision, SVNStatusType.INAPPLICABLE, SVNStatusType.CONFLICTED,
                        SVNStatusType.LOCK_INAPPLICABLE, SVNEventAction.SKIP, SVNEventAction.UPDATE_UPDATE,
                        null, null);
                event.setPreviousRevision(entry.getRevision());
              event.setURL(entry.getSVNURL());
                myWCAccess.handleEvent(event);
                return;
            }
        } else {
            myCurrentDirectory.myPreviousRevision = -1;
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

                // skip event for anchor when there is a target.
                SVNEventAction action = myCurrentDirectory.isAddExisted || myCurrentDirectory.isExisted ? SVNEventAction.UPDATE_EXISTS : SVNEventAction.UPDATE_UPDATE;
                if (propStatus == SVNStatusType.UNKNOWN && action != SVNEventAction.UPDATE_EXISTS) {
                    action = SVNEventAction.UPDATE_NONE;
                }
                SVNEvent event = SVNEventFactory.createSVNEvent(adminArea.getRoot(), SVNNodeKind.DIR, null, myTargetRevision, SVNStatusType.UNKNOWN, propStatus, null, action, null, null, null);
                event.setPreviousRevision(myCurrentDirectory.myPreviousRevision);
              event.setURL(myCurrentDirectory.URL != null ? SVNURL.parseURIEncoded(myCurrentDirectory.URL) : null);
                myWCAccess.handleEvent(event);
            }
        }
        myCurrentDirectory = myCurrentDirectory.Parent;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

        if (hasTextConflicts || hasPropConflicts) {
            info.isSkipped = true;
            Collection skippedPaths = getSkippedPaths();
            File file = new File(myAdminInfo.getAnchor().getRoot(), path);
            skippedPaths.add(file);
            SVNEvent event = SVNEventFactory.createSVNEvent(adminArea.getFile(info.Name), SVNNodeKind.FILE,
                    null, myTargetRevision, hasTextConflicts ? SVNStatusType.CONFLICTED : SVNStatusType.UNKNOWN,
                    hasPropConflicts ? SVNStatusType.CONFLICTED : SVNStatusType.UNKNOWN,
                    SVNStatusType.LOCK_INAPPLICABLE, SVNEventAction.SKIP, SVNEventAction.UPDATE_UPDATE, null, null);
            event.setPreviousRevision(entry.getRevision());
          event.setURL(entry.getSVNURL());
            myWCAccess.handleEvent(event);
        }
        return info;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

                    action = SVNEventAction.UPDATE_EXISTS;
                }
            } else if (fileInfo.IsAdded) {
                action = SVNEventAction.UPDATE_ADD;
            }
            SVNEvent event = SVNEventFactory.createSVNEvent(adminArea.getFile(fileInfo.Name), SVNNodeKind.FILE,  null, myTargetRevision, textStatus, propStatus, lockStatus, action, null, null, null);
            event.setPreviousRevision(previousRevision);
          event.setPreviousURL(previousURL);
          event.setURL(fileInfo.URL != null ? SVNURL.parseURIEncoded(fileInfo.URL) : null);
            myWCAccess.handleEvent(event);
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

              isReplace = true;
              newAction = SVNEventAction.UPDATE_REPLACE;
            } else {
              newAction = kas.myAction;
            }
                SVNEvent event = SVNEventFactory.createSVNEvent(myCurrentDirectory.myWCFile, kas.myKind, null,
                    SVNRepository.INVALID_REVISION, kas.myStatus, kas.myStatus, SVNStatusType.INAPPLICABLE,
                    newAction, expectedAction, null, null);
                myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
                myDeletedPaths.remove(myCurrentDirectory.myWCFile);

          }
          if (!isReplace) {
                // TODO prop type?
            SVNEvent event = SVNEventFactory.createSVNEvent(myCurrentDirectory.myWCFile, SVNNodeKind.DIR,
                    null, SVNRepository.INVALID_REVISION, type, type, null, action, expectedAction, null, null);
                myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
          }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

                dir = retrieve(myCurrentDirectory.myWCFile, myIsDryRun);
            } catch (SVNException e) {
                if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) {
                    if (myEventHandler != null) {
                        action = myCurrentDirectory.myIsTreeConflicted ? SVNEventAction.TREE_CONFLICT : SVNEventAction.SKIP;
                        SVNEvent event = SVNEventFactory.createSVNEvent(myCurrentDirectory.myWCFile,
                            SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNStatusType.MISSING,
                            SVNStatusType.MISSING, null, action, expectedAction, null, null);
                        myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
                    }
                    myCurrentDirectory = myCurrentDirectory.myParent;
                    return;
                }
                throw e;
            }
            if (!myIsDryRun || dir != null) {
                boolean[] isTreeConflicted = { false };
                type = getDiffCallback().propertiesChanged(myCurrentDirectory.myRepositoryPath, myCurrentDirectory.myBaseProperties,
                        myCurrentDirectory.myPropertyDiff, isTreeConflicted);
                if (isTreeConflicted[0]) {
                    myCurrentDirectory.myIsTreeConflicted = true;
                }
            }
        }

        getDiffCallback().directoryClosed(myCurrentDirectory.myRepositoryPath, null);
       
        if (type == SVNStatusType.UNKNOWN) {
            action = SVNEventAction.UPDATE_NONE;
        }

        if (!myCurrentDirectory.myIsAdded && myEventHandler != null) {
            for (Iterator deletedPathsIter = myDeletedPaths.keySet().iterator(); deletedPathsIter.hasNext();) {
              File deletedPath = (File) deletedPathsIter.next();
              KindActionState kas = (KindActionState) myDeletedPaths.get(deletedPath);
                SVNEvent event = SVNEventFactory.createSVNEvent(deletedPath, kas.myKind, null,
                    SVNRepository.INVALID_REVISION, kas.myStatus, kas.myStatus, SVNStatusType.INAPPLICABLE,
                    kas.myAction, kas.myExpectedAction, null, null);
                myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
                deletedPathsIter.remove();
            }

            action = myCurrentDirectory.myIsTreeConflicted ? SVNEventAction.TREE_CONFLICT : action;
            SVNEvent event = SVNEventFactory.createSVNEvent(myCurrentDirectory.myWCFile,
                SVNNodeKind.DIR, null, SVNRepository.INVALID_REVISION, SVNStatusType.INAPPLICABLE, type,
                SVNStatusType.INAPPLICABLE, action, expectedAction, null, null);
            myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
        }
        myCurrentDirectory = myCurrentDirectory.myParent;
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

            retrieveParent(wcFile, myIsDryRun);
        } catch (SVNException e) {
            if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) {
                if (myEventHandler != null) {
                    action = SVNEventAction.SKIP;
                    SVNEvent event = SVNEventFactory.createSVNEvent(wcFile,
                            SVNNodeKind.FILE, null, SVNRepository.INVALID_REVISION, SVNStatusType.MISSING,
                            SVNStatusType.UNKNOWN, null, action, expectedAction, null, null);
                    myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
                }
                return;
            }
            throw e;
        }
        if (file != null || !propertyDiff.isEmpty()) {
            String baseMimeType = baseProperties.getStringValue(SVNProperty.MIME_TYPE);
            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,
                        baseProperties, propertyDiff, isTreeConflicted);
            }
        }
       
        if (isTreeConflicted != null && isTreeConflicted.length > 0 && isTreeConflicted[0]) {
            action = SVNEventAction.TREE_CONFLICT;
        } else if (type[0] == SVNStatusType.MISSING || type[0] == SVNStatusType.OBSTRUCTED) {
            action = SVNEventAction.SKIP;
        } else if (added) {
            action = SVNEventAction.UPDATE_ADD;
        } else {
            action = SVNEventAction.UPDATE_UPDATE;
        }

        if (myEventHandler != null) {
            boolean isReplace = false;
            KindActionState kas = (KindActionState) myDeletedPaths.get(wcFile);
            if (kas != null) {
                SVNEventAction newAction = kas.myAction;
                if (kas.myAction == SVNEventAction.UPDATE_DELETE && action == SVNEventAction.UPDATE_ADD) {
                    isReplace = true;
                    newAction = SVNEventAction.UPDATE_REPLACE;
                }
                SVNEvent event = SVNEventFactory.createSVNEvent(wcFile, kas.myKind, null,
                        SVNRepository.INVALID_REVISION, kas.myStatus, kas.myStatus, SVNStatusType.INAPPLICABLE,
                        newAction, expectedAction, null, null);
                myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
                myDeletedPaths.remove(wcFile);
            }

            if (!isReplace) {
                SVNEvent event = SVNEventFactory.createSVNEvent(wcFile, SVNNodeKind.FILE,
                        null, SVNRepository.INVALID_REVISION, type[0], type[1], null, action, expectedAction,
                        null, null);
                myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
            }
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

    }

    public void absentDir(String path) throws SVNException {
        if (myCurrentDirectory.myWCFile != null) {
            File dir = new File(myCurrentDirectory.myWCFile, SVNPathUtil.tail(path));
            SVNEvent event = SVNEventFactory.createSVNEvent(dir, SVNNodeKind.DIR,
                    null, SVNRepository.INVALID_REVISION, SVNStatusType.MISSING, SVNStatusType.MISSING, SVNStatusType.MISSING, SVNEventAction.SKIP, SVNEventAction.SKIP,
                    null, null);
            myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNEvent

    }

    public void absentFile(String path) throws SVNException {
        if (myCurrentDirectory.myWCFile != null) {
            File file = new File(myCurrentDirectory.myWCFile, SVNPathUtil.tail(path));
            SVNEvent event = SVNEventFactory.createSVNEvent(file, SVNNodeKind.FILE,
                    null, SVNRepository.INVALID_REVISION, SVNStatusType.MISSING, SVNStatusType.MISSING, SVNStatusType.MISSING, SVNEventAction.SKIP, SVNEventAction.SKIP,
                    null, null);
            myEventHandler.handleEvent(event, ISVNEventHandler.UNKNOWN);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.