use of org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener in project maven-scm by apache.
the class CvsJavaExportCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected ExportScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsLogListener logListener = new CvsLogListener();
CvsUpdateConsumer consumer = new CvsUpdateConsumer(getLogger());
try {
boolean isSuccess = CvsConnection.processCommand(cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger());
if (!isSuccess) {
return new ExportScmResult(cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false);
}
BufferedReader stream = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(logListener.getStdout().toString().getBytes())));
String line;
while ((line = stream.readLine()) != null) {
consumer.consumeLine(line);
}
} catch (Exception e) {
e.printStackTrace();
return new ExportScmResult(cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false);
}
return new ExportScmResult(cl.toString(), consumer.getUpdatedFiles());
}
use of org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener in project maven-scm by apache.
the class CvsJavaTagCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected TagScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsLogListener logListener = new CvsLogListener();
CvsTagConsumer consumer = new CvsTagConsumer(getLogger());
try {
boolean isSuccess = CvsConnection.processCommand(cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger());
if (!isSuccess) {
return new TagScmResult(cl.toString(), "The cvs tag command failed.", logListener.getStderr().toString(), false);
}
BufferedReader stream = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(logListener.getStdout().toString().getBytes())));
String line;
while ((line = stream.readLine()) != null) {
consumer.consumeLine(line);
}
} catch (Exception e) {
e.printStackTrace();
return new TagScmResult(cl.toString(), "The cvs tag command failed.", logListener.getStderr().toString(), false);
}
return new TagScmResult(cl.toString(), consumer.getTaggedFiles());
}
use of org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener in project maven-scm by apache.
the class CvsJavaBranchCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected BranchScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsLogListener logListener = new CvsLogListener();
CvsBranchConsumer consumer = new CvsBranchConsumer(getLogger());
try {
boolean isSuccess = CvsConnection.processCommand(cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger());
if (!isSuccess) {
return new BranchScmResult(cl.toString(), "The cvs branch command failed.", logListener.getStderr().toString(), false);
}
BufferedReader stream = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(logListener.getStdout().toString().getBytes())));
String line;
while ((line = stream.readLine()) != null) {
consumer.consumeLine(line);
}
} catch (Exception e) {
getLogger().error(e.getMessage(), e);
return new BranchScmResult(cl.toString(), "The cvs branch command failed.", logListener.getStderr().toString(), false);
}
return new BranchScmResult(cl.toString(), consumer.getTaggedFiles());
}
use of org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener in project maven-scm by apache.
the class CvsJavaDiffCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected DiffScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsLogListener logListener = new CvsLogListener();
CvsDiffConsumer consumer = new CvsDiffConsumer(getLogger(), cl.getWorkingDirectory());
try {
boolean isSuccess = CvsConnection.processCommand(cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger());
if (!isSuccess) {
return new DiffScmResult(cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false);
}
BufferedReader stream = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(logListener.getStdout().toString().getBytes())));
String line;
while ((line = stream.readLine()) != null) {
consumer.consumeLine(line);
}
} catch (Exception e) {
e.printStackTrace();
return new DiffScmResult(cl.toString(), "The cvs command failed.", logListener.getStdout().toString(), false);
}
return new DiffScmResult(cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch());
}
use of org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener in project maven-scm by apache.
the class CvsJavaStatusCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected StatusScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsLogListener logListener = new CvsLogListener();
CvsStatusConsumer consumer = new CvsStatusConsumer(getLogger(), cl.getWorkingDirectory());
try {
boolean isSuccess = CvsConnection.processCommand(cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger());
if (!isSuccess) {
return new StatusScmResult(cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false);
}
BufferedReader stream = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(logListener.getStdout().toString().getBytes())));
String line;
while ((line = stream.readLine()) != null) {
consumer.consumeLine(line);
}
} catch (Exception e) {
e.printStackTrace();
return new StatusScmResult(cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false);
}
return new StatusScmResult(cl.toString(), consumer.getChangedFiles());
}
Aggregations