提交 779968fd 编写于 作者: K kohsuke

Dump the stderr from "cvs log" if it fails.

See http://www.nabble.com/Problem-with-cvs-log-command-tt18440437.html

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10866 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a7288df7
......@@ -312,9 +312,14 @@ public class ChangeLogTask extends AbstractCvsTask {
}
protected @Override ExecuteStreamHandler getExecuteStreamHandler(InputStream input) {
return handler = new RedirectingStreamHandler(
// stdout goes to the changelog parser,
// but we also send this to Ant logger so that we can see it at sufficient debug level
new ForkOutputStream(new RedirectingOutputStream(parser),
new LogOutputStream(this,Project.MSG_VERBOSE)),
input);
// stderr goes to the logger, too
new LogOutputStream(this,Project.MSG_WARN),
input);
}
private static final long VERSION_1_11_2 = 11102;
......
......@@ -38,7 +38,7 @@ class RedirectingStreamHandler extends PumpStreamHandler {
this(out, new ByteArrayOutputStream(), in);
}
RedirectingStreamHandler(OutputStream out, OutputStream err, InputStream in) {
RedirectingStreamHandler(OutputStream out, OutputStream err, InputStream in) {
super(out, err, in);
}
......
......@@ -17,7 +17,6 @@ import hudson.model.ModelObject;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.model.TaskThread;
import hudson.model.Descriptor;
import hudson.org.apache.tools.ant.taskdefs.cvslib.ChangeLogTask;
import hudson.remoting.Future;
import hudson.remoting.RemoteOutputStream;
......@@ -729,10 +728,13 @@ public class CVSSCM extends SCM implements Serializable {
ChangeLogTask task = new ChangeLogTask() {
public void log(String msg, int msgLevel) {
// send error to listener. This seems like the route in which the changelog task
// sends output
if(msgLevel==org.apache.tools.ant.Project.MSG_ERR) {
if(msgLevel==org.apache.tools.ant.Project.MSG_ERR)
hadError[0] = true;
// send error to listener. This seems like the route in which the changelog task
// sends output.
// Also in ChangeLogTask.getExecuteStreamHandler, we send stderr from CVS
// at WARN level.
if(msgLevel<=org.apache.tools.ant.Project.MSG_WARN) {
errorOutput.write(msg);
errorOutput.write('\n');
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册