Package org.tmatesoft.svn.core.wc

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


                    LOGGER.warn("No test matrix found in " + testDefPath + " under " + svnPath);
                    return null;
                }
                */
                final Long revision = fetchRevision.length() > 0 ? parseRevisionOrDie(fetchRevision) : Long.valueOf(-1);
                final SVNRevision svnRevision = revision.longValue() > 0 ? SVNRevision.create(revision.longValue()) : SVNRevision.HEAD;
                final SVNLogClient logClient = clientManager.getLogClient();
                final FilterableSVNDirEntryHandler handler = new FilterableSVNDirEntryHandler();
                final SVNURL url = SvnPersisterCoreImpl.this.svnUrl.appendPath(testDefPath, false);
                logClient.doList(url,
                                 svnRevision,
View Full Code Here


                    return defaultValue;
                }

                final SVNWCClient client = clientManager.getWCClient();
                final SVNURL url = svnUrl.appendPath(path, true);
                final SVNRevision svnRevision = SVNRevision.create(revision);

                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                client.doGetFileContents(url, svnRevision, svnRevision, /* expandKeywords */ false, baos);
                final C testDefinition = objectMapper.readValue(baos.toByteArray(), c);
                try {
View Full Code Here

    public String getExternalFilePath() {
        return (String) myAttributes.get(SVNProperty.FILE_EXTERNAL_PATH);
    }
   
    public SVNRevision getExternalFileRevision() {
        SVNRevision revision = (SVNRevision) myAttributes.get(SVNProperty.FILE_EXTERNAL_REVISION);
        return revision;
    }
View Full Code Here

        SVNRevision revision = (SVNRevision) myAttributes.get(SVNProperty.FILE_EXTERNAL_REVISION);
        return revision;
    }
   
    public SVNRevision getExternalFilePegRevision() {
        SVNRevision pegRevision = (SVNRevision) myAttributes.get(SVNProperty.FILE_EXTERNAL_PEG_REVISION);
        return pegRevision;
    }
View Full Code Here

            }
            if (isURL() && revStr.length() > 6 &&
                    revStr.toLowerCase().startsWith("%7b") && revStr.toLowerCase().endsWith("%7d")) {
                revStr = SVNEncodingUtil.uriDecode(revStr);
            }
            SVNRevision revision = SVNRevision.parse(revStr);
            if (revision != SVNRevision.UNDEFINED) {
                if (use) {
                    myPegRevision = revision;
                }
                myTarget = myTarget.substring(0, index);
View Full Code Here

            final ISVNLogEntryHandler handler) throws SVNException {
        if (paths == null || paths.length == 0 || handler == null) {
            return;
        }
       
        SVNRevision sessionRevision = SVNRevision.UNDEFINED;
        List editedRevisionRanges = new LinkedList();
        for (Iterator revRangesIter = revisionRanges.iterator(); revRangesIter.hasNext();) {
            SVNRevisionRange revRange = (SVNRevisionRange) revRangesIter.next();
            if (revRange.getStartRevision().isValid() && !revRange.getEndRevision().isValid()) {
                revRange = new SVNRevisionRange(revRange.getStartRevision(), revRange.getStartRevision());  
            } else if (!revRange.getStartRevision().isValid()) {
                SVNRevision start = SVNRevision.UNDEFINED;
                SVNRevision end = SVNRevision.UNDEFINED;
                if (!pegRevision.isValid()) {
                    start = SVNRevision.BASE;
                } else {
                    start = pegRevision;
                }
               
                if (!revRange.getEndRevision().isValid()) {
                    end = SVNRevision.create(0);
                }
                revRange = new SVNRevisionRange(start, end);
            }
           
            if (!revRange.getStartRevision().isValid() || !revRange.getEndRevision().isValid()) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION, "Missing required revision specification");
                SVNErrorManager.error(err, SVNLogType.WC);
            }
           
            editedRevisionRanges.add(revRange);
            if (!sessionRevision.isValid()) {
                SVNRevision start = revRange.getStartRevision();
                SVNRevision end = revRange.getEndRevision();
                if (SVNRevision.isValidRevisionNumber(start.getNumber()) && SVNRevision.isValidRevisionNumber(end.getNumber())) {
                    sessionRevision = start.getNumber() > end.getNumber() ? start : end;
                } else if (start.getDate() != null && end.getDate() != null) {
                    sessionRevision = start.getDate().compareTo(end.getDate()) > 0 ? start : end;
                }
            }
        }
       
        if (limit > Integer.MAX_VALUE) {
            limit = Integer.MAX_VALUE;
        }
       
        ISVNLogEntryHandler wrappingHandler = new ISVNLogEntryHandler() {
            public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                checkCancelled();
                handler.handleLogEntry(logEntry);
            }
        };
       
        SVNURL[] urls = new SVNURL[paths.length];
        SVNWCAccess wcAccess = createWCAccess();
        Collection wcPaths = new ArrayList();
        for (int i = 0; i < paths.length; i++) {
            checkCancelled();
            File path = paths[i];
            wcPaths.add(path.getAbsolutePath().replace(File.separatorChar, '/'));
            SVNAdminArea area = wcAccess.probeOpen(path, false, 0);
            SVNEntry entry = wcAccess.getVersionedEntry(path, false);
            if (entry.getURL() == null) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL,
                        "Entry ''{0}'' has no URL", path);
                SVNErrorManager.error(err, SVNLogType.WC);
            }
            urls[i] = entry.getSVNURL();
            if (area != null) {
                wcAccess.closeAdminArea(area.getRoot());
            }
        }
       
        if (urls.length == 0) {
            return;
        }
       
        String[] wcPathsArray = (String[]) wcPaths.toArray(new String[wcPaths.size()]);
        String rootWCPath = SVNPathUtil.condencePaths(wcPathsArray, null, true);
        Collection targets = new TreeSet();
        SVNURL baseURL = SVNURLUtil.condenceURLs(urls, targets, true);
        if (baseURL == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET,
                    "target log paths belong to different repositories");
            SVNErrorManager.error(err, SVNLogType.WC);
        }
        if (targets.isEmpty()) {
            targets.add("");
        }
        if (!pegRevision.isValid()) {
            pegRevision = SVNRevision.WORKING;
        }
       
        SVNRepository repos = null;
        if (rootWCPath != null && needsWC(pegRevision)) {           
            // open and use wc to create repository.
            File root = new Resource(rootWCPath);
            SVNAdminArea area = wcAccess.probeOpen(root, false, 0);
            repos = createRepository(null, root, area, pegRevision, sessionRevision, null);
            if (area != null) {
                wcAccess.closeAdminArea(area.getRoot());
            }
        } else {
            repos = createRepository(baseURL, null, null, pegRevision, sessionRevision, null);
        }
       
        String[] targetPaths = (String[]) targets.toArray(new String[targets.size()]);
       
        for (int i = 0; i < targetPaths.length; i++) {
            targetPaths[i] = SVNEncodingUtil.uriDecode(targetPaths[i]);
        }

        for (Iterator revRangesIter = editedRevisionRanges.iterator(); revRangesIter.hasNext();) {
            checkCancelled();
           
            SVNRevisionRange revRange = (SVNRevisionRange) revRangesIter.next();
            SVNRevision startRevision = revRange.getStartRevision();
            SVNRevision endRevision = revRange.getEndRevision();
           
            if (startRevision.isLocal() || endRevision.isLocal()) {
                for (int i = 0; i < paths.length; i++) {
                    checkCancelled();
                    long startRev = getRevisionNumber(startRevision, repos, paths[i]);
                    long endRev = getRevisionNumber(endRevision, repos, paths[i]);
                    repos.log(targetPaths, startRev, endRev, discoverChangedPaths, stopOnCopy, limit,
View Full Code Here

     * @since                          1.3, SVN 1.6
     */
    public void doLog(SVNURL url, String[] paths, SVNRevision pegRevision, Collection revisionRanges, boolean stopOnCopy,
            boolean discoverChangedPaths, boolean includeMergedRevisions, long limit, String[] revisionProperties,
            final ISVNLogEntryHandler handler) throws SVNException {
        SVNRevision sessionRevision = SVNRevision.UNDEFINED;
        List editedRevisionRanges = new LinkedList();
        for (Iterator revRangesIter = revisionRanges.iterator(); revRangesIter.hasNext();) {
            SVNRevisionRange revRange = (SVNRevisionRange) revRangesIter.next();
            if (revRange.getStartRevision().isValid() && !revRange.getEndRevision().isValid()) {
                revRange = new SVNRevisionRange(revRange.getStartRevision(), revRange.getStartRevision());  
            } else if (!revRange.getStartRevision().isValid()) {
                SVNRevision start = SVNRevision.UNDEFINED;
                SVNRevision end = SVNRevision.UNDEFINED;
                if (!pegRevision.isValid()) {
                    start = SVNRevision.HEAD;
                } else {
                    start = pegRevision;
                }
               
                if (!revRange.getEndRevision().isValid()) {
                    end = SVNRevision.create(0);
                }
                revRange = new SVNRevisionRange(start, end);
            }
           
            if (!revRange.getStartRevision().isValid() || !revRange.getEndRevision().isValid()) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION, "Missing required revision specification");
                SVNErrorManager.error(err, SVNLogType.WC);
            }
           
            if (needsWC(revRange.getStartRevision()) || needsWC(revRange.getEndRevision())) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION,
                        "Revision type requires a working copy path, not a URL");
                SVNErrorManager.error(err, SVNLogType.WC);
            }
           
            editedRevisionRanges.add(revRange);
            if (!sessionRevision.isValid()) {
                SVNRevision start = revRange.getStartRevision();
                SVNRevision end = revRange.getEndRevision();
                if (SVNRevision.isValidRevisionNumber(start.getNumber()) && SVNRevision.isValidRevisionNumber(end.getNumber())) {
                    sessionRevision = start.getNumber() > end.getNumber() ? start : end;
                } else if (start.getDate() != null && end.getDate() != null) {
                    sessionRevision = start.getDate().compareTo(end.getDate()) > 0 ? start : end;
                }
            }
        }

        if (needsWC(pegRevision)) {
View Full Code Here

    }

    private String serializeExternalFileData(Map entryAttrs) throws SVNException {
        String representation = null;
        String path = (String) entryAttrs.get(SVNProperty.FILE_EXTERNAL_PATH);
        SVNRevision revision = (SVNRevision) entryAttrs.get(SVNProperty.FILE_EXTERNAL_REVISION);
        SVNRevision pegRevision = (SVNRevision) entryAttrs.get(SVNProperty.FILE_EXTERNAL_PEG_REVISION);
        if (path != null) {
            String revStr = asString(revision, path);
            String pegRevStr = asString(pegRevision, path);
            representation = pegRevStr + ":" + revStr + ":" + path;
        }
View Full Code Here

        SVNErrorManager.error(err, SVNLogType.WC);
        return null;
    }
   
    private void unserializeExternalFileData(Map entryAttrs, String rawExternalFileData) throws SVNException {
        SVNRevision pegRevision = SVNRevision.UNDEFINED;
        SVNRevision revision = SVNRevision.UNDEFINED;
        String path = null;
        if (rawExternalFileData != null) {
            StringBuffer buffer = new StringBuffer(rawExternalFileData);
            pegRevision = parseRevision(buffer);
            revision = parseRevision(buffer);
View Full Code Here

            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.INCORRECT_PARAMS,
                    "Found an unexpected \\0 in the file external ''{0}''", str);
            SVNErrorManager.error(err, SVNLogType.WC);
        }
       
        SVNRevision revision = null;
        String subStr = str.substring(0, ind);
        if (subStr.equals(SVNRevision.HEAD.getName())) {
            revision = SVNRevision.HEAD;
        } else {
            revision = SVNRevision.parse(subStr);
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.wc.SVNRevision

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.