Index: D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateConsumer.java
===================================================================
--- D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateConsumer.java (revision 0)
+++ D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateConsumer.java (revision 0)
@@ -0,0 +1,223 @@
+package org.apache.maven.scm.provider.vss.commands.update;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.provider.vss.commands.VssConstants;
+import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository;
+import org.apache.maven.scm.util.AbstractConsumer;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * @author Thorsten Riek
+ * @version $Id: VssGetConsumer.java 374388 2006-02-02 14:00:46Z triek $
+ */
+public class VssUpdateConsumer
+ extends AbstractConsumer
+ implements StreamConsumer
+{
+
+ /**
+ * expecting file information
+ */
+ private static final int GET_UNKNOWN = 0;
+
+ /**
+ * expecting file information
+ */
+ private static final int GET_FILE = 1;
+
+ /**
+ * expecting file information
+ */
+ private static final int REPLACE_FILE = 2;
+
+ /**
+ * expecting file path information
+ */
+ private static final int GET_FILE_PATH = 3;
+
+ /**
+ * expecting writable copy
+ */
+ private static final int IS_WRITABLE_COPY = 4;
+
+ /**
+ * expecting working folder
+ */
+ private static final int SET_WORKING_FOLDER = 5;
+
+ /**
+ * Marks start of file data
+ */
+ private static String START_FILE_PATH = "$/";
+
+ /**
+ * Marks getting a new File
+ */
+ private static final String START_GETTING = "Getting";
+
+ /**
+ * Marks replacing a old File
+ */
+ private static final String START_REPLACING = "Replacing local copy of ";
+
+ /**
+ * Marks a writable copy of a File / maybe a conflict
+ */
+ private static final String START_WRITABLE_COPY = "A writable ";
+
+ /**
+ * Marks "Set the default folder for project" question
+ */
+ private static final String CONTAINS_SET_DEFAULT_WORKING_FOLDER = "as the default folder for project";
+
+ private String currentPath = "";
+
+ private List updatedFiles = new ArrayList();
+
+ private VssScmProviderRepository repo;
+
+ public VssUpdateConsumer( VssScmProviderRepository repo, ScmLogger logger )
+ {
+ super( logger );
+ this.repo = repo;
+ }
+
+ public void consumeLine( String line )
+ {
+ getLogger().debug( line );
+
+ switch ( getLineStatus( line ) )
+ {
+ case GET_FILE_PATH:
+ processGetFilePath( line );
+ break;
+ case GET_FILE:
+ processGetFile( line );
+ break;
+ case REPLACE_FILE:
+ processReplaceFile( line );
+ break;
+ case IS_WRITABLE_COPY:
+ // FIXME is actually in error stream if command is build without -G-
+ processWritableFile( line );
+ break;
+ case SET_WORKING_FOLDER:
+ // to trash
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * 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 ) );
+ getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] );
+
+ }
+
+ /**
+ * Process the current input line in the Replace File state.
+ *
+ * @param line a line of text from the VSS log output
+ */
+ private void processReplaceFile( String line )
+ {
+
+ updatedFiles.add( new ScmFile( currentPath + "/" + line.substring(START_REPLACING.length()), ScmFileStatus.UPDATED ) );
+ getLogger().info( START_REPLACING + currentPath + "/" + line.substring(START_REPLACING.length()) );
+
+
+ }
+
+ /**
+ * Process the current input line in the Get File Path state.
+ *
+ * @param line a line of text from the VSS log output
+ */
+ private void processGetFilePath( String line )
+ {
+ currentPath = line.substring( (VssConstants.PROJECT_PREFIX + repo.getProject()).length() ,
+ line.length() - 1 );
+ }
+
+ /**
+ * Process the current input line in the writable File state.
+ *
+ * @param line a line of text from the VSS log output
+ */
+ private void processWritableFile( String line )
+ {
+ // FIXME extract file name
+ // String[] fileLine = line.split( " " );
+ // updatedFiles.add( new ScmFile( currentPath + "/" + fileLine[1], ScmFileStatus.MODIFIED ) );
+ // getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] );
+
+ }
+
+ /**
+ * Identify the status of a vss get line
+ *
+ * @param line The line to process
+ * @return status
+ */
+ private int getLineStatus( String line )
+ {
+ int argument = GET_UNKNOWN;
+ if ( line.startsWith( START_FILE_PATH ) )
+ {
+ argument = GET_FILE_PATH;
+ }
+ else if ( line.startsWith( START_GETTING ) )
+ {
+ argument = GET_FILE;
+ }
+ else if ( line.startsWith( START_REPLACING ) )
+ {
+ argument = REPLACE_FILE;
+ }
+ else if ( line.startsWith( START_WRITABLE_COPY ) )
+ {
+ argument = IS_WRITABLE_COPY;
+ }
+ else if ( line.indexOf( CONTAINS_SET_DEFAULT_WORKING_FOLDER ) != -1 )
+ {
+ argument = SET_WORKING_FOLDER;
+ }
+
+ return argument;
+ }
+
+ public List getUpdatedFiles()
+ {
+ return updatedFiles;
+ }
+
+}
Index: D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateCommand.java
===================================================================
--- D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateCommand.java (revision 0)
+++ D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateCommand.java (revision 0)
@@ -0,0 +1,135 @@
+package org.apache.maven.scm.provider.vss.commands.update;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.changelog.ChangeLogCommand;
+import org.apache.maven.scm.command.update.AbstractUpdateCommand;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils;
+import org.apache.maven.scm.provider.vss.commands.VssConstants;
+import org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand;
+import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+public class VssUpdateCommand
+ extends AbstractUpdateCommand
+{
+// TODO handle deleted files from VSS
+ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tag )
+ throws ScmException
+ {
+ getLogger().debug( "executing update command..." );
+
+ VssScmProviderRepository repo = (VssScmProviderRepository) repository;
+
+ Commandline cl = buildCmdLine( repo, fileSet, tag );
+
+ VssUpdateConsumer consumer = new VssUpdateConsumer( repo, getLogger() );
+
+ // TODO handle deleted files from VSS
+ // TODO identify local files
+ CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+ int exitCode;
+
+ getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() );
+
+ exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );
+
+ if ( exitCode != 0 )
+ {
+ String error = stderr.getOutput();
+ if (error.indexOf("A writable copy of") < 0) {
+ return new UpdateScmResult( cl.toString(), "The vss command failed.", error, false );
+ }
+ // print out the writable copy for manual handling
+ getLogger().warn(error);
+ }
+
+ return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() );
+ }
+
+ public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet, String lable )
+ throws ScmException
+ {
+
+ Commandline command = new Commandline();
+
+ command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
+
+ try
+ {
+ command.addSystemEnvironment();
+ }
+ catch ( Exception e )
+ {
+ throw new ScmException( "Can't add system environment.", e );
+ }
+
+ command.addEnvironment( "SSDIR", repo.getVssdir() );
+
+ String ssDir = VssCommandLineUtils.getSsDir();
+
+ command.setExecutable( ssDir + VssConstants.SS_EXE );
+
+ command.createArgument().setValue( VssConstants.COMMAND_GET );
+
+ command.createArgument().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() );
+
+ //User identification to get access to vss repository
+ if ( repo.getUserPassword() != null )
+ {
+ command.createArgument().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() );
+ }
+
+ //Display the history of an entire project list
+ command.createArgument().setValue( VssConstants.FLAG_RECURSION );
+
+ //Ignore: Do not ask for input under any circumstances.
+ command.createArgument().setValue( VssConstants.FLAG_AUTORESPONSE_DEF );
+
+ // FIXME Update command only works if there is no file checked out
+ // or no file is dirty locally. It's better than overwriting
+ // checked out files
+ //Ignore: Do not touch local writable files.
+ command.createArgument().setValue( VssConstants.FLAG_SKIP_WRITABLE );
+// command.createArgument().setValue( VssConstants.FLAG_REPLACE_WRITABLE );
+
+
+ // ToDo: Get Labled Version
+ // command.createArgument().setValue( VssConstants.FLAG_VERSION_LABEL );
+
+ return command;
+ }
+
+ /**
+ * @see org.apache.maven.scm.command.update.AbstractUpdateCommand#getChangeLogCommand()
+ */
+ protected ChangeLogCommand getChangeLogCommand()
+ {
+ VssHistoryCommand command = new VssHistoryCommand();
+
+ command.setLogger( getLogger() );
+
+ return command;
+ }
+
+}
Index: D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/VssCommandLineUtils.java
===================================================================
--- D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/VssCommandLineUtils.java (revision 408578)
+++ D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/VssCommandLineUtils.java (working copy)
@@ -33,6 +33,7 @@
import java.io.FileReader;
import java.io.IOException;
+// FIXME extend CommandLineUtils
public class VssCommandLineUtils
implements VssConstants
{
@@ -44,7 +45,7 @@
}
}
- public static Commandline getBaseSvnCommandLine( File workingDirectory, String cmd,
+ public static Commandline getBaseVssCommandLine( File workingDirectory, String cmd,
VssScmProviderRepository repository )
{
Commandline cl = new Commandline();
@@ -77,7 +78,11 @@
logger.info( "Executing: " + cl );
logger.info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() );
- return CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+ int exitcode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
+
+ logger.debug( "VSS Command Exit_Code: " + exitcode );
+
+ return exitcode;
}
catch ( CommandLineException ex )
{
Index: D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java
===================================================================
--- D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java (revision 0)
+++ D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.java (revision 0)
@@ -0,0 +1,130 @@
+package org.apache.maven.scm.provider.vss.commands.checkout;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.changelog.ChangeLogCommand;
+import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils;
+import org.apache.maven.scm.provider.vss.commands.VssConstants;
+import org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand;
+import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+public class VssCheckOutCommand
+ extends AbstractCheckOutCommand
+{
+
+ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tag )
+ throws ScmException
+ {
+ getLogger().debug( "executing checkout command..." );
+
+ VssScmProviderRepository repo = (VssScmProviderRepository) repository;
+
+ Commandline cl = buildCmdLine( repo, fileSet, tag );
+
+ VssCheckOutConsumer consumer = new VssCheckOutConsumer( repo, getLogger() );
+
+ // TODO handle deleted files from VSS
+ CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
+
+ int exitCode;
+
+ getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() );
+
+ exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );
+
+ if ( exitCode != 0 )
+ {
+ String error = stderr.getOutput();
+ if (error.indexOf("A writable copy of") < 0) {
+ return new CheckOutScmResult( cl.toString(), "The vss command failed.", error, false );
+ }
+ // print out the writable copy for manual handling
+ getLogger().warn(error);
+ }
+
+ return new CheckOutScmResult( cl.toString(), consumer.getUpdatedFiles() );
+ }
+
+ public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet, String lable )
+ throws ScmException
+ {
+
+ Commandline command = new Commandline();
+
+ command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
+
+ try
+ {
+ command.addSystemEnvironment();
+ }
+ catch ( Exception e )
+ {
+ throw new ScmException( "Can't add system environment.", e );
+ }
+
+ command.addEnvironment( "SSDIR", repo.getVssdir() );
+
+ String ssDir = VssCommandLineUtils.getSsDir();
+
+ command.setExecutable( ssDir + VssConstants.SS_EXE );
+
+ command.createArgument().setValue( VssConstants.COMMAND_GET );
+
+ command.createArgument().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() );
+
+ //User identification to get access to vss repository
+ if ( repo.getUserPassword() != null )
+ {
+ command.createArgument().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() );
+ }
+
+ //Display the history of an entire project list
+ command.createArgument().setValue( VssConstants.FLAG_RECURSION );
+
+ //Ignore: Do not ask for input under any circumstances.
+ command.createArgument().setValue( VssConstants.FLAG_AUTORESPONSE_DEF );
+
+ //Ignore: Do not touch local writable files.
+ command.createArgument().setValue( VssConstants.FLAG_REPLACE_WRITABLE );
+
+ // ToDo: Get Labled Version
+ // command.createArgument().setValue( VssConstants.FLAG_VERSION_LABEL );
+
+ return command;
+ }
+
+ /**
+ * @see org.apache.maven.scm.command.checkout.AbstractCheckOutCommand#getChangeLogCommand()
+ */
+ protected ChangeLogCommand getChangeLogCommand()
+ {
+ VssHistoryCommand command = new VssHistoryCommand();
+
+ command.setLogger( getLogger() );
+
+ return command;
+ }
+
+
+}
Index: D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutConsumer.java
===================================================================
--- D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutConsumer.java (revision 0)
+++ D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutConsumer.java (revision 0)
@@ -0,0 +1,204 @@
+package org.apache.maven.scm.provider.vss.commands.checkout;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.provider.vss.commands.VssConstants;
+import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository;
+import org.apache.maven.scm.util.AbstractConsumer;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * @author Thorsten Riek
+ * @version $Id: VssGetConsumer.java 374388 2006-02-02 14:00:46Z triek $
+ */
+public class VssCheckOutConsumer
+ extends AbstractConsumer
+ implements StreamConsumer
+{
+
+ /**
+ * expecting file information
+ */
+ private static final int GET_UNKNOWN = 0;
+
+ /**
+ * expecting file information
+ */
+ private static final int GET_FILE = 1;
+
+ /**
+ * expecting file information
+ */
+ private static final int REPLACE_FILE = 2;
+
+ /**
+ * expecting file path information
+ */
+ private static final int GET_FILE_PATH = 3;
+
+ /**
+ * expecting writable copy
+ */
+ private static final int IS_WRITABLE_COPY = 4;
+
+ /**
+ * expecting working folder
+ */
+ private static final int SET_WORKING_FOLDER = 5;
+
+ /**
+ * Marks start of file data
+ */
+ private static String START_FILE_PATH = "$/";
+
+ /**
+ * Marks getting a new File
+ */
+ private static final String START_GETTING = "Getting";
+
+ /**
+ * Marks replacing a old File
+ */
+ private static final String START_REPLACING = "Replacing local copy of ";
+
+ /**
+ * Marks a writable copy of a File / maybe a conflict
+ */
+ private static final String START_WRITABLE_COPY = "A writable ";
+
+ /**
+ * Marks "Set the default folder for project" question
+ */
+ private static final String CONTAINS_SET_DEFAULT_WORKING_FOLDER = "as the default folder for project";
+
+ private String currentPath = "";
+
+ private List updatedFiles = new ArrayList();
+
+ private VssScmProviderRepository repo;
+
+ public VssCheckOutConsumer( VssScmProviderRepository repo, ScmLogger logger )
+ {
+ super( logger );
+ this.repo = repo;
+ }
+
+ public void consumeLine( String line )
+ {
+ getLogger().debug( line );
+
+ switch ( getLineStatus( line ) )
+ {
+ case GET_FILE_PATH:
+ processGetFilePath( line );
+ break;
+ case GET_FILE:
+ processGetFile( line );
+ break;
+ case REPLACE_FILE:
+ processReplaceFile( line );
+ break;
+ case IS_WRITABLE_COPY:
+ // will be overwritten and uses REPLACE_FILE
+ break;
+ case SET_WORKING_FOLDER:
+ // to trash
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * 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 ) );
+ getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] );
+ }
+
+ /**
+ * Process the current input line in the Replace File state.
+ *
+ * @param line a line of text from the VSS log output
+ */
+ private void processReplaceFile( String line )
+ {
+ updatedFiles.add( new ScmFile( currentPath + "/" + line.substring(START_REPLACING.length()), ScmFileStatus.UPDATED ) );
+ getLogger().info( START_REPLACING + currentPath + "/" + line.substring(START_REPLACING.length()) );
+ }
+
+ /**
+ * Process the current input line in the Get File Path state.
+ *
+ * @param line a line of text from the VSS log output
+ */
+ private void processGetFilePath( String line )
+ {
+ currentPath = line.substring( (VssConstants.PROJECT_PREFIX + repo.getProject()).length() ,
+ line.length() - 1 );
+ }
+
+ /**
+ * Identify the status of a vss get line
+ *
+ * @param line The line to process
+ * @return status
+ */
+ private int getLineStatus( String line )
+ {
+ int argument = GET_UNKNOWN;
+ if ( line.startsWith( START_FILE_PATH ) )
+ {
+ argument = GET_FILE_PATH;
+ }
+ else if ( line.startsWith( START_GETTING ) )
+ {
+ argument = GET_FILE;
+ }
+ else if ( line.startsWith( START_REPLACING ) )
+ {
+ argument = REPLACE_FILE;
+ }
+ else if ( line.startsWith( START_WRITABLE_COPY ) )
+ {
+ argument = IS_WRITABLE_COPY;
+ }
+ else if ( line.indexOf( CONTAINS_SET_DEFAULT_WORKING_FOLDER ) != -1 )
+ {
+ argument = SET_WORKING_FOLDER;
+ }
+
+ return argument;
+ }
+
+ public List getUpdatedFiles()
+ {
+ return updatedFiles;
+ }
+
+}
Index: D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/VssScmProvider.java
===================================================================
--- D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/VssScmProvider.java (revision 408578)
+++ D:/work-maven/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/VssScmProvider.java (working copy)
@@ -20,9 +20,13 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.provider.AbstractScmProvider;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand;
+import org.apache.maven.scm.provider.vss.commands.checkout.VssCheckOutCommand;
+import org.apache.maven.scm.provider.vss.commands.update.VssUpdateCommand;
import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;
@@ -142,7 +146,6 @@
* org.apache.maven.scm.ScmFileSet,
* org.apache.maven.scm.CommandParameters)
*/
-/*
public CheckOutScmResult checkout( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
throws ScmException
{
@@ -153,7 +156,6 @@
return (CheckOutScmResult) command.execute( repository
.getProviderRepository(), fileSet, parameters );
}
-*/
/**
* @see org.apache.maven.scm.provider.AbstractScmProvider#changelog(org.apache.maven.scm.repository.ScmRepository,
@@ -194,18 +196,16 @@
* org.apache.maven.scm.ScmFileSet,
* org.apache.maven.scm.CommandParameters)
*/
-/*
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters )
throws ScmException
{
- VssGetCommand command = new VssGetCommand();
+ VssUpdateCommand command = new VssUpdateCommand();
command.setLogger( getLogger() );
return (UpdateScmResult) command.execute( repository
.getProviderRepository(), fileSet, parameters );
}
-*/
/**
* @see org.apache.maven.scm.provider.AbstractScmProvider#remove(org.apache.maven.scm.repository.ScmRepository,