Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.ISVNLogEntryHandler


     * @see                     org.tmatesoft.svn.core.SVNLogEntry
     * @see                     org.tmatesoft.svn.core.SVNLogEntryPath
     */
    public Collection log(String[] targetPaths, Collection entries, long startRevision, long endRevision, boolean changedPath, boolean strictNode) throws SVNException {
        final Collection result = entries != null ? entries : new LinkedList();
        log(targetPaths, startRevision, endRevision, changedPath, strictNode, new ISVNLogEntryHandler() {
            public void handleLogEntry(SVNLogEntry logEntry) {
                result.add(logEntry);
            }       
        });
        return result;
View Full Code Here


    protected long getPathLastChangeRevision(String relPath, long revision, SVNRepository repository) throws SVNException {
        final long[] rev = new long[1];
        rev[0] = SVNRepository.INVALID_REVISION;

            repository.log(new String[] { relPath }, 1, revision, false, true, 1, false, null,
                    new ISVNLogEntryHandler() {
                public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                    rev[0] = logEntry.getRevision();
                }
            });
        return rev[0];
View Full Code Here

                    final ISVNLogEntryHandler handler) throws SVNException {
        if (targetPaths == null || targetPaths.length == 0) {
            targetPaths = new String[]{""};
        }
        DAVLogHandler davHandler = null;
        ISVNLogEntryHandler cachingHandler = new ISVNLogEntryHandler() {
                public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                    if (logEntry.getDate() != null) {
                        getOptions().saveCommitMessage(DAVRepository.this, logEntry.getRevision(), logEntry.getMessage());
                    }
                    if (handler != null) {
                        handler.handleLogEntry(logEntry);
                    }
                }           
        };
       
        long latestRev = -1;
        if (isInvalidRevision(startRevision)) {
            startRevision = latestRev = getLatestRevision();
        }
        if (isInvalidRevision(endRevision)) {
            endRevision = latestRev != -1 ? latestRev : getLatestRevision();
        }
       
        try {
            openConnection();
            DAVConnection connection = getConnection();
            String[] fullPaths = new String[targetPaths.length];
           
            for (int i = 0; i < targetPaths.length; i++) {
                fullPaths[i] = doGetFullPath(targetPaths[i]);
            }
            Collection relativePaths = new SVNHashSet();
            String path = SVNPathUtil.condencePaths(fullPaths, relativePaths, false);
            if (relativePaths.isEmpty()) {
                relativePaths.add("");
            }
            fullPaths = (String[]) relativePaths.toArray(new String[relativePaths.size()]);
           
            StringBuffer request = DAVLogHandler.generateLogRequest(null, startRevision, endRevision, changedPath,
                    strictNode, includeMergedRevisions, revPropNames, limit, fullPaths);
            davHandler = new DAVLogHandler(cachingHandler, limit, revPropNames);
            if (davHandler.isWantCustomRevprops()) {
                String capability = connection.getCapabilityResponse(SVNCapability.LOG_REVPROPS);
                if (!DAVConnection.DAV_CAPABILITY_SERVER_YES.equals(capability) &&
                        !DAVConnection.DAV_CAPABILITY_YES.equals(capability)) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED,
                            "Server does not support custom revprops via log");
                    SVNErrorManager.error(err, SVNLogType.NETWORK);
                }
            }
            long revision = Math.max(startRevision, endRevision);
            path = SVNEncodingUtil.uriEncode(path);
            DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, path, revision, false, false, null);
            path = SVNPathUtil.append(info.baselineBase, info.baselinePath);
            try {
                HTTPStatus status = connection.doReport(path, request, davHandler);
                if (status.getError() != null) {
                    SVNErrorManager.error(status.getError(), SVNLogType.NETWORK);
                }
            } catch (SVNException e) {
                if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.UNKNOWN &&
                        davHandler.isCompatibleMode()) {
                    cachingHandler.handleLogEntry(SVNLogEntry.EMPTY_ENTRY);
                } else {
                    throw e;
                }
               
            }
View Full Code Here

            }
        }
       
        final List changedRevs = new LinkedList();
        repository.log(new String[] { "" }, youngestRev, oldestRev, false, false, 0, false, new String[0],
                new ISVNLogEntryHandler() {
            public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                changedRevs.add(new Long(logEntry.getRevision()));
            }
        });
       
View Full Code Here

      }

      // we want to check all the paths that have changed
      logClient.doLog(SVNURL.parseURIEncoded(project.getUrl()), new String[] { "" },
          SVNRevision.HEAD, SVNRevision.create(project.getLastCheckedVersion()),
          SVNRevision.create(targetRevision), true, true, 0, new ISVNLogEntryHandler() {

            public void handleLogEntry(SVNLogEntry entry) throws SVNException {
              for (Object key : entry.getChangedPaths().keySet()) {
                changedPaths.add(key.toString());
              }
View Full Code Here

       
        if (limit > Integer.MAX_VALUE) {
            limit = Integer.MAX_VALUE;
        }
       
        ISVNLogEntryHandler wrappingHandler = new ISVNLogEntryHandler() {
            public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                checkCancelled();
                handler.handleLogEntry(logEntry);
            }
        };
View Full Code Here

        if (limit > Integer.MAX_VALUE) {
            limit = Integer.MAX_VALUE;
        }
       
        paths = paths == null || paths.length == 0 ? new String[] {""} : paths;
        ISVNLogEntryHandler wrappingHandler = new ISVNLogEntryHandler() {
            public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                checkCancelled();
                handler.handleLogEntry(logEntry);
            }
        };
View Full Code Here

            }
        }
       
        final List changedRevs = new LinkedList();
        repository.log(new String[] { "" }, youngestRev, oldestRev, false, false, 0, false, new String[0],
                new ISVNLogEntryHandler() {
            public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                changedRevs.add(new Long(logEntry.getRevision()));
            }
        });
       
View Full Code Here

    protected long getPathLastChangeRevision(String relPath, long revision, SVNRepository repository) throws SVNException {
        final long[] rev = new long[1];
        rev[0] = SVNRepository.INVALID_REVISION;

            repository.log(new String[] { relPath }, 1, revision, false, true, 1, false, null,
                    new ISVNLogEntryHandler() {
                public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                    rev[0] = logEntry.getRevision();
                }
            });
        return rev[0];
View Full Code Here

            String commitMessage = revisionProps.getStringValue(SVNRevisionProperty.LOG);

            currentRevision[0] = null;

            checkCancelled();
            src.log(new String[]{""}, i, i, true, false, 1, new ISVNLogEntryHandler() {
                public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
                    currentRevision[0] = logEntry;
                }
            });
            checkCancelled();
View Full Code Here

TOP

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

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.