提交 b472c639 编写于 作者: K kohsuke

added debug probe.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5781 71c3de6d-444a-0410-be80-ed276b4c234a
上级 e1129103
......@@ -8,6 +8,8 @@ import hudson.remoting.VirtualChannel;
import hudson.FilePath.FileCallable;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.ISVNLogEntryHandler;
import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNLogClient;
......@@ -112,16 +114,38 @@ final class SubversionChangeLogBuilder {
}
try {
if(debug)
listener.getLogger().printf("Computing changelog of %1s from %2s to %3s\n",
SVNURL.parseURIEncoded(url), prevRev+1, thisRev);
svnlc.doLog(SVNURL.parseURIEncoded(url),null,
SVNRevision.UNDEFINED, SVNRevision.create(prevRev+1),
SVNRevision.create(thisRev),
false, true, Long.MAX_VALUE, logHandler);
false, true, Long.MAX_VALUE,
debug ? new DebugSVNLogHandler(logHandler) : logHandler);
if(debug)
listener.getLogger().println("done");
} catch (SVNException e) {
e.printStackTrace(listener.error("revision check failed on "+url));
}
return true;
}
/**
* Filter {@link ISVNLogEntryHandler} that dumps information. Used only for debugging.
*/
private class DebugSVNLogHandler implements ISVNLogEntryHandler {
private final ISVNLogEntryHandler core;
private DebugSVNLogHandler(ISVNLogEntryHandler core) {
this.core = core;
}
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
listener.getLogger().println("SVNLogEntry="+logEntry);
core.handleLogEntry(logEntry);
}
}
/**
* Creates an identity transformer.
*/
......@@ -135,6 +159,8 @@ final class SubversionChangeLogBuilder {
private static final LocatorImpl DUMMY_LOCATOR = new LocatorImpl();
public static boolean debug = false;
static {
DUMMY_LOCATOR.setLineNumber(-1);
DUMMY_LOCATOR.setColumnNumber(-1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册