Examples of SVNLogEntryPath


Examples of org.tmatesoft.svn.core.SVNLogEntryPath

        myCopiedPaths = new SVNHashMap();
        myChangedPaths = revision.getChangedPaths();

        for(Iterator paths = myChangedPaths.keySet().iterator(); paths.hasNext();){
            String path = (String)paths.next();
            SVNLogEntryPath pathChange = (SVNLogEntryPath)myChangedPaths.get(path);
            //make sure it's a copy
            if((pathChange.getType() == SVNLogEntryPath.TYPE_REPLACED || pathChange.getType() == SVNLogEntryPath.TYPE_ADDED) && pathChange.getCopyPath() != null && pathChange.getCopyRevision() >= 0){
                myCopiedPaths.put(path, pathChange);
            }
        }
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

     *                       reflect <code>path</code> deletion in <code>revision</code> 
     *
     */
    public void deleteEntry(String path, long revision) throws SVNException {
        String absPath = getSourceRepository().getRepositoryPath(path);
        SVNLogEntryPath deletedPath = (SVNLogEntryPath) myChangedPaths.get(absPath);
        if (deletedPath != null && (deletedPath.getType() == SVNLogEntryPath.TYPE_DELETED ||
                deletedPath.getType() == SVNLogEntryPath.TYPE_REPLACED)) {
            if (deletedPath.getType() == SVNLogEntryPath.TYPE_DELETED) {
                myChangedPaths.remove(absPath);
            }
        } else {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                    "Expected that path ''{0}'' is deleted in revision {1}",
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

     */
    public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException {
        String absPath = getSourceRepository().getRepositoryPath(path);
        EntryBaton baton = new EntryBaton(absPath);
        myDirsStack.push(baton);
        SVNLogEntryPath changedPath = (SVNLogEntryPath) myChangedPaths.get(absPath);
        if (changedPath != null && (changedPath.getType() == SVNLogEntryPath.TYPE_ADDED || changedPath.getType() == SVNLogEntryPath.TYPE_REPLACED) && changedPath.getCopyPath() != null && changedPath.getCopyRevision() >= 0) {
            baton.myPropsAct = DECIDE;
            SVNProperties props = new SVNProperties();
            getSourceRepository().getDir(changedPath.getCopyPath(), changedPath.getCopyRevision(), props, (ISVNDirEntryHandler) null);
            baton.myProps = props;
           
            if (changedPath.getType() == SVNLogEntryPath.TYPE_REPLACED) {
                myCommitEditor.deleteEntry(path, myPreviousRevision);
                myChangedPaths.remove(absPath);
            }
            myCommitEditor.addDir(path, changedPath.getCopyPath(), changedPath.getCopyRevision());
        } else if (changedPath != null && (changedPath.getType() == SVNLogEntryPath.TYPE_ADDED || changedPath.getType() == SVNLogEntryPath.TYPE_REPLACED)) {
            baton.myPropsAct = ACCEPT;
            myCommitEditor.addDir(path, null, -1);
        } else if (changedPath != null && changedPath.getType() == SVNLogEntryPath.TYPE_MODIFIED) {
            baton.myPropsAct = ACCEPT;
            myCommitEditor.openDir(path, myPreviousRevision);
        } else if (changedPath == null) {
            baton.myPropsAct = IGNORE;
            myCommitEditor.openDir(path, myPreviousRevision);
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

     */
    public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException {
        String absPath = getSourceRepository().getRepositoryPath(path);
        EntryBaton baton = new EntryBaton(absPath);
        myPathsToFileBatons.put(path, baton);
        SVNLogEntryPath changedPath = (SVNLogEntryPath) myChangedPaths.get(absPath);
       
        if (changedPath != null && (changedPath.getType() == SVNLogEntryPath.TYPE_ADDED || changedPath.getType() == SVNLogEntryPath.TYPE_REPLACED) && changedPath.getCopyPath() != null && changedPath.getCopyRevision() >= 0) {
            baton.myPropsAct = DECIDE;
            baton.myTextAct = ACCEPT;
            SVNProperties props = new SVNProperties();
            if (areFileContentsEqual(absPath, myTargetRevision, changedPath.getCopyPath(), changedPath.getCopyRevision(), props)) {
                baton.myTextAct = IGNORE;
            }
            baton.myProps = props;
            if(changedPath.getType() == SVNLogEntryPath.TYPE_REPLACED){
                myCommitEditor.deleteEntry(path, myPreviousRevision);
                myChangedPaths.remove(absPath);
            }
            myCommitEditor.addFile(path, changedPath.getCopyPath(), changedPath.getCopyRevision());
        } else if (changedPath != null && (changedPath.getType() == SVNLogEntryPath.TYPE_ADDED || changedPath.getType() == SVNLogEntryPath.TYPE_REPLACED)) {
            baton.myPropsAct = ACCEPT;
            baton.myTextAct = ACCEPT;
            if(changedPath.getType() == SVNLogEntryPath.TYPE_REPLACED){
                myCommitEditor.deleteEntry(path, myPreviousRevision);
                myChangedPaths.remove(absPath);
            }
            myCommitEditor.addFile(path, null, -1);
        } else if (changedPath != null && changedPath.getType() == SVNLogEntryPath.TYPE_MODIFIED) {
            baton.myPropsAct = DECIDE;
            baton.myTextAct = ACCEPT;
            SVNLogEntryPath realPath = getFileCopyOrigin(absPath);
            if (realPath == null) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "Unknown error, can't get the copy origin of a file");
                SVNErrorManager.error(err, SVNLogType.FSFS);
            }
            SVNProperties props = new SVNProperties();
            if (areFileContentsEqual(absPath, myTargetRevision, realPath.getCopyPath(), realPath.getCopyRevision(), props)) {
                baton.myTextAct = IGNORE;
            }
            baton.myProps = props;
            myCommitEditor.openFile(path, myPreviousRevision);
        } else if (changedPath == null) {
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

        for(Iterator paths = myChangedPaths.keySet().iterator(); paths.hasNext();){
            String path = (String)paths.next();
            if (!path.startsWith(dirPath + "/")) {
                continue;
            }
            SVNLogEntryPath pathChange = (SVNLogEntryPath)myChangedPaths.get(path);
            if(pathChange.getType() == SVNLogEntryPath.TYPE_DELETED){
                String relativePath = path.substring(dirPath.length() + 1);
                pathsToDelete.add(relativePath);
            }
        }
        String[] pathsArray = (String[]) pathsToDelete.toArray(new String[pathsToDelete.size()]);
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

    }

    private SVNLogEntryPath getFileCopyOrigin(String path) throws SVNException {
        Object[] paths = myCopiedPaths.keySet().toArray();
        Arrays.sort(paths, 0, paths.length, SVNPathUtil.PATH_COMPARATOR);
        SVNLogEntryPath realPath = null;
        List candidates = new ArrayList();
        for (int i = 0; i < paths.length; i++) {
            String copiedPath = (String) paths[i];
           
            if (!path.startsWith(copiedPath + "/")) {
                continue;
            } else if (path.equals(copiedPath)) {
                return (SVNLogEntryPath) myCopiedPaths.get(copiedPath);
            }
            candidates.add(copiedPath);
        }
        // check candidates from the end of the list
        for(int i = candidates.size() - 1; i >=0; i--) {
            String candidateParent = (String) candidates.get(i);
            if (getSourceRepository().checkPath(candidateParent, myTargetRevision) != SVNNodeKind.DIR) {
                continue;
            }
            SVNLogEntryPath changedPath = (SVNLogEntryPath) myCopiedPaths.get(candidateParent);
            String fileRelativePath = path.substring(candidateParent.length() + 1);
            fileRelativePath = SVNPathUtil.append(changedPath.getCopyPath(), fileRelativePath);
            return new SVNLogEntryPath(path, ' ', fileRelativePath, changedPath.getCopyRevision());
        }
        return realPath;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

        if (copyFromRevision != null && copyFromRevision.length > 0) {
            copyFromRevision[0] = INVALID_REVISION;
        }
        String previousPath = null;
        if (changedPaths != null) {
            SVNLogEntryPath change = (SVNLogEntryPath) changedPaths.get(path);
            if (change != null) {
                if (change.getType() != SVNLogEntryPath.TYPE_ADDED &&
                        change.getType() != SVNLogEntryPath.TYPE_REPLACED) {
                    previousPath = path;
                } else {
                    if (change.getCopyPath() != null) {
                        previousPath = change.getCopyPath();
                    }
                    if (action != null && action.length > 0) {
                        action[0] = change.getType();
                    }
                    if (copyFromRevision != null && copyFromRevision.length > 0) {
                        copyFromRevision[0] = change.getCopyRevision();
                    }
                    return previousPath;
                }
            }
           
            if (!changedPaths.isEmpty()) {
                String[] sortedPaths = (String[]) changedPaths.keySet().toArray(new String[changedPaths.size()]);
                Arrays.sort(sortedPaths, SVNPathUtil.PATH_COMPARATOR);
                for (int i = sortedPaths.length; i > 0; i--) {
                    String changedPath = sortedPaths[i - 1];
                    if (!(path.startsWith(changedPath) && path.length() > changedPath.length() &&
                            path.charAt(changedPath.length()) == '/')) {
                        continue;
                    }
                   
                    change = (SVNLogEntryPath) changedPaths.get(changedPath);
                    if (change.getCopyPath() != null) {
                        if (action != null && action.length > 0) {
                            action[0] = change.getType();
                        }
                        if (copyFromRevision != null && copyFromRevision.length > 0) {
                            copyFromRevision[0] = change.getCopyRevision();
                        }
                        previousPath = SVNPathUtil.append(change.getCopyPath(),
                                path.substring(changedPath.length() + 1));
                        break;
                    }
                }
            }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

        public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
            Map changedPaths = logEntry.getChangedPaths();
            for (Iterator changedPathsIter = changedPaths.keySet().iterator(); changedPathsIter.hasNext();) {
                String path = (String) changedPathsIter.next();
                SVNLogEntryPath change = (SVNLogEntryPath) changedPaths.get(path);
                if (myPath.equals(path) && (change.getType() == SVNLogEntryPath.TYPE_DELETED ||
                        change.getType() == SVNLogEntryPath.TYPE_REPLACED)) {
                   
                    myDeletedRevision = logEntry.getRevision();
                }
            }
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

            cp = new ChangePath[]{};
        } else {
            Collection clientChangePaths = new ArrayList();
            for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) {
                String path = (String) iter.next();
                SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path);
                if(entryPath != null){
                    clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType(), getNodeKind(entryPath.getKind())));
                }
            }
            cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]);
        }
        SVNProperties revisionProperties = logEntry.getRevisionProperties();
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

            cp = new ChangePath[]{};
        }else{
            Collection clientChangePaths = new ArrayList();
            for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) {
                String path = (String) iter.next();
                SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path);
                if(entryPath != null){
                    clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType(), getNodeKind(entryPath.getKind())));
                }
            }
            cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]);
            // sort by paths.
            Arrays.sort(cp, CHANGE_PATH_COMPARATOR);
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.