Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNNodeKind


        SVNRepository repository1 = createRepository(url1, null, null, true);
        SVNRepository repository2 = createRepository(url2, null, null, false);
       
        final long rev1 = getRevisionNumber(revision1, repository1, path1);
        long rev2 = -1;
        SVNNodeKind kind1 = null;
        SVNNodeKind kind2 = null;
        String target1 = null;

        try {
            rev2 = getRevisionNumber(revision2, repository2, path2);
           
View Full Code Here


        if (makeParents) {
            CopyPair pair = (CopyPair) copyPairs.get(0);
            String relativeDir = SVNPathUtil.getPathAsChild(topURL, SVNPathUtil.removeTail(pair.myDst));
            if (relativeDir != null) {
                relativeDir = SVNEncodingUtil.uriDecode(relativeDir);
                SVNNodeKind kind = topRepos.checkPath(relativeDir, -1);
                while(kind == SVNNodeKind.NONE) {
                    newDirs.add(relativeDir);
                    relativeDir = SVNPathUtil.removeTail(relativeDir);
                    kind = topRepos.checkPath(relativeDir, -1);
                }
            }
        }

        String rootURL = topRepos.getRepositoryRoot(true).toString();
        for (int i = 0; i < copyPairs.size(); i++) {
            CopyPair pair = (CopyPair) copyPairs.get(i);
            CopyPathInfo info = (CopyPathInfo) pathInfos.get(i);
            if (!pair.myDst.equals(rootURL) && SVNPathUtil.getPathAsChild(pair.myDst, pair.mySource) != null) {
                info.isResurrection = true;
                // TODO still looks like a bug.
//                if (SVNPathUtil.removeTail(pair.myDst).equals(topURL)) {
                topURL = SVNPathUtil.removeTail(topURL);
//                }
            }
        }

        topRepos.setLocation(SVNURL.parseURIEncoded(topURL), false);
        long latestRevision = topRepos.getLatestRevision();

        for (int i = 0; i < copyPairs.size(); i++) {
            CopyPair pair = (CopyPair) copyPairs.get(i);
            CopyPathInfo info = (CopyPathInfo) pathInfos.get(i);
            pair.mySourceRevisionNumber = getRevisionNumber(pair.mySourceRevision, topRepos, null);
            info.mySourceRevisionNumber = pair.mySourceRevisionNumber;

            SVNRepositoryLocation[] locations = getLocations(SVNURL.parseURIEncoded(pair.mySource), null, topRepos, pair.mySourcePegRevision, pair.mySourceRevision, SVNRevision.UNDEFINED);
            pair.mySource = locations[0].getURL().toString();
            String srcRelative = SVNPathUtil.getPathAsChild(topURL, pair.mySource);
            if (srcRelative != null) {
                srcRelative = SVNEncodingUtil.uriDecode(srcRelative);
            } else {
                srcRelative = "";
            }
            String dstRelative = SVNPathUtil.getPathAsChild(topURL, pair.myDst);
            if (dstRelative != null) {
                dstRelative = SVNEncodingUtil.uriDecode(dstRelative);
            } else {
                dstRelative = "";
            }
            if ("".equals(srcRelative) && isMove) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Cannot move URL ''{0}'' into itself", SVNURL.parseURIEncoded(pair.mySource));
                SVNErrorManager.error(err, SVNLogType.WC);
            }
            info.mySourceKind = topRepos.checkPath(srcRelative, pair.mySourceRevisionNumber);
            if (info.mySourceKind == SVNNodeKind.NONE) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND,
                        "Path ''{0}'' does not exist in revision {1}", new Object[] {SVNURL.parseURIEncoded(pair.mySource), new Long(pair.mySourceRevisionNumber)});
                SVNErrorManager.error(err, SVNLogType.WC);
            }
            SVNNodeKind dstKind = topRepos.checkPath(dstRelative, latestRevision);
            if (dstKind != SVNNodeKind.NONE) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_ALREADY_EXISTS,
                        "Path ''{0}'' already exists", dstRelative);
                SVNErrorManager.error(err, SVNLogType.WC);
            }
View Full Code Here

        boolean save = false;

        for(Iterator entries = dir.entries(true); entries.hasNext();) {
            SVNEntry entry = (SVNEntry) entries.next();
            boolean deleted = entry.isDeleted();
            SVNNodeKind kind = entry.getKind();
            boolean force = false;
            if (entry.getDepth() == SVNDepth.EXCLUDE) {
                continue;
            }
View Full Code Here

            SVNRepository repos = createRepository(SVNURL.parseURIEncoded(topDstURL), adminArea.getRoot(),
                    wcAccess, true);
            List newDirs = new ArrayList();
            if (makeParents) {
                String rootURL = topDstURL;
                SVNNodeKind kind = repos.checkPath("", -1);
                while(kind == SVNNodeKind.NONE) {
                    newDirs.add(rootURL);
                    rootURL = SVNPathUtil.removeTail(rootURL);
                    repos.setLocation(SVNURL.parseURIEncoded(rootURL), false);
                    kind = repos.checkPath("", -1);
                }
                topDstURL = rootURL;
            }

            for (int i = 0; i < copyPairs.size(); i++) {
                CopyPair pair = (CopyPair) copyPairs.get(i);
                SVNEntry entry = wcAccess.getEntry(new File(pair.mySource), false);
                pair.mySourceRevisionNumber = entry.getRevision();
                String dstRelativePath = SVNPathUtil.getPathAsChild(topDstURL, pair.myDst);
                dstRelativePath = SVNEncodingUtil.uriDecode(dstRelativePath);
                SVNNodeKind kind = repos.checkPath(dstRelativePath, -1);
                if (kind != SVNNodeKind.NONE) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_ALREADY_EXISTS,
                            "Path ''{0}'' already exists", SVNURL.parseURIEncoded(pair.myDst));
                    SVNErrorManager.error(err, SVNLogType.WC);
                }
View Full Code Here

            String reposPath = topSrcRepos.getLocation().toString();
            for (Iterator pairs = copyPairs.iterator(); pairs.hasNext();) {
                CopyPair pair = (CopyPair) pairs.next();
                String relativePath = SVNPathUtil.getPathAsChild(reposPath, pair.mySource);
                relativePath = SVNEncodingUtil.uriDecode(relativePath);
                SVNNodeKind kind = topSrcRepos.checkPath(relativePath, pair.mySourceRevisionNumber);
                if (kind == SVNNodeKind.NONE) {
                    SVNErrorMessage err;
                    if (pair.mySourceRevisionNumber >= 0) {
                        err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Path ''{0}'' not found in revision {1}",
                                new Object[] {SVNURL.parseURIEncoded(pair.mySource), new Long(pair.mySourceRevisionNumber)});
View Full Code Here

    public void targetRevision(long revision) throws SVNException {
    }

    public void deleteEntry(String path, long revision) throws SVNException {
        SVNNodeKind kind = myRepository.checkPath(path, myRevision);
        SVNDiffStatus status = new SVNDiffStatus(new File(myAnchor, path), myRootURL.appendPath(path, false), path, SVNStatusType.STATUS_DELETED, false, kind);
        myHandler.handleDiffStatus(status);
    }
View Full Code Here

      return handler.getRevisionNumber();
    }

    public SVNNodeKind checkPath(String path, long revision) throws SVNException {
        DAVBaselineInfo info = null;
        SVNNodeKind kind = SVNNodeKind.NONE;
        try {
            openConnection();
            path = doGetFullPath(path);
            path = SVNEncodingUtil.uriEncode(path);
            DAVConnection connection = getConnection();
View Full Code Here

                    if (parentPathSegments == SVNPathUtil.getSegmentsCount(href)) {
                        continue;
                    }
                    String name = SVNEncodingUtil.uriDecode(SVNPathUtil.tail(href));
                   
                    SVNNodeKind kind = SVNNodeKind.UNKNOWN;
                    if ((entryFields & SVNDirEntry.DIRENT_KIND) != 0) {
                        kind = child.isCollection() ? SVNNodeKind.DIR : SVNNodeKind.FILE; 
                    }
                   
                    long size = 0;
View Full Code Here

                String href = child.getURL();
                String name = "";
                if (parentPathSegments != SVNPathUtil.getSegmentsCount(href)) {
                    name = SVNEncodingUtil.uriDecode(SVNPathUtil.tail(href));
                }
                SVNNodeKind kind = SVNNodeKind.FILE;
                Object revisionStr = child.getPropertyValue(DAVElement.VERSION_NAME);
                long lastRevision = -1;
                try {
                    lastRevision = Long.parseLong(revisionStr.toString());
                } catch (NumberFormatException nfe) {
View Full Code Here

    private SVNDirEntry createDirEntry(String fullPath, DAVProperties child) throws SVNException {
        String href = child.getURL();
        href = SVNEncodingUtil.uriDecode(href);
        String name = SVNPathUtil.tail(href);
        // build direntry
        SVNNodeKind kind = SVNNodeKind.FILE;
        Object revisionStr = child.getPropertyValue(DAVElement.VERSION_NAME);
        long lastRevision = -1;
        try {
            lastRevision = Long.parseLong(revisionStr.toString());
        } catch (NumberFormatException nfe) {
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNNodeKind

Copyright © 2018 www.massapicom. 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.