use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class ListMojo method execute.
/**
* {@inheritDoc}
*/
public void execute() throws MojoExecutionException {
super.execute();
try {
ScmRepository repository = getScmRepository();
ListScmResult result = getScmManager().list(repository, getFileSet(), recursive, getScmVersion(scmVersionType, scmVersion));
checkResult(result);
if (result.getFiles() != null) {
for (ScmFile scmFile : result.getFiles()) {
getLog().info(scmFile.getPath());
}
}
} catch (ScmException e) {
throw new MojoExecutionException("Cannot run list command : ", e);
} catch (IOException e) {
throw new MojoExecutionException("Cannot run list command : ", e);
}
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class AccuRevRemoveCommand method executeAccurevCommand.
@Override
protected ScmResult executeAccurevCommand(AccuRevScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException, AccuRevException {
AccuRev accuRev = repository.getAccuRev();
String message = parameters.getString(CommandParameter.MESSAGE, "");
File basedir = fileSet.getBasedir();
List<File> relativeFiles = fileSet.getFileList();
final List<File> removedFiles = accuRev.defunct(basedir, relativeFiles, message);
if (removedFiles != null) {
List<ScmFile> resultFiles = getScmFiles(removedFiles, ScmFileStatus.DELETED);
return new RemoveScmResult(accuRev.getCommandLines(), resultFiles);
} else {
return new RemoveScmResult(accuRev.getCommandLines(), "AccuRev Error", accuRev.getErrorOutput(), false);
}
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class VssCheckInConsumer method processGetFile.
/**
* Process the current input line in the Get File state.
*
* @param line a line of text from the VSS log output
*/
private void processGetFile(String line) {
String[] fileLine = line.split(" ");
updatedFiles.add(new ScmFile(currentPath + "/" + fileLine[1], ScmFileStatus.UPDATED));
if (getLogger().isInfoEnabled()) {
getLogger().info(fileLine[0] + ": " + currentPath + "/" + fileLine[1]);
}
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class VssEditConsumer method processGetFile.
/**
* Process the current input line in the Get File state.
*
* @param line a line of text from the VSS log output
*/
private void processGetFile(String line) {
String[] fileLine = line.split(" ");
updatedFiles.add(new ScmFile(currentPath + "/" + fileLine[1], ScmFileStatus.EDITED));
if (getLogger().isInfoEnabled()) {
getLogger().info(fileLine[0] + ": " + currentPath + "/" + fileLine[1]);
}
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class VssStatusConsumer method processLastStateFiles.
/**
* Process the current input line in the Get File state.
*
* @param line a line of text from the VSS log output
*/
private void processLastStateFiles(String line) {
if (line != null && line.trim().length() > 0) {
if (lastState == DIFF_START_DIFFING_LOCAL) {
setLocalFolder(localFolder + line);
getLogger().debug("Local folder: " + localFolder);
} else if (lastState == DIFF_START_DIFFING_REMOTE) {
setRemoteProjectFolder(remoteProjectFolder + line);
getLogger().debug("Remote folder: " + localFolder);
}
String[] fileLine = line.split(" ");
for (int i = 0; i < fileLine.length; i++) {
if (fileLine[i].trim().length() > 0) {
if (lastState == DIFF_LOCAL_FILES_NOT_IN_PROJECT) {
updatedFiles.add(new ScmFile(localFolder + fileLine[i], ScmFileStatus.ADDED));
} else if (lastState == DIFF_VSS_FILES_NOT_IN_CURRENT_FOLDER) {
updatedFiles.add(new ScmFile(localFolder + fileLine[i], ScmFileStatus.UPDATED));
} else if (lastState == DIFF_VSS_FILES_DIFFERENT_FROM_LOCAL_FILES) {
updatedFiles.add(new ScmFile(localFolder + fileLine[i], ScmFileStatus.MODIFIED));
}
if (getLogger().isDebugEnabled()) {
getLogger().debug(localFolder + fileLine[i]);
}
}
}
} else {
if (getLogger().isDebugEnabled()) {
getLogger().debug("processLastStateFiles: empty line");
}
}
}
Aggregations