maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-scm/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus components.xml
Date Mon, 10 Jan 2005 11:51:29 GMT
brett       2005/01/10 03:51:29

  Modified:    maven-scm-api/src/main/java/org/apache/maven/scm
                        CommandParameter.java
               maven-scm-api/src/main/java/org/apache/maven/scm/command/diff
                        AbstractDiffCommand.java
               maven-scm-api/src/main/java/org/apache/maven/scm/manager
                        DefaultScmManager.java ScmManager.java
               maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update
                        SvnUpdateCommand.java
               maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus
                        components.xml
  Added:       maven-scm-api/src/main/java/org/apache/maven/scm/command/diff
                        DiffScmResult.java
               maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update
                        SvnUpdateScmResult.java
  Removed:     maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update
                        ScmUpdateScmResult.java
  Log:
  start diff implementation
  
  Revision  Changes    Path
  1.3       +3 -1      maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
  
  Index: CommandParameter.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CommandParameter.java	26 Oct 2004 12:37:05 -0000	1.2
  +++ CommandParameter.java	10 Jan 2005 11:51:29 -0000	1.3
  @@ -48,6 +48,8 @@
   
       public final static CommandParameter END_REVISION = new CommandParameter( "endRevision"
);
   
  +    public final static CommandParameter OUTPUT_FILE = new CommandParameter( "outputFile"
);
  +
       private String name;
   
       public CommandParameter( String name )
  
  
  
  1.4       +9 -6      maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java
  
  Index: AbstractDiffCommand.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractDiffCommand.java	24 Dec 2004 03:04:46 -0000	1.3
  +++ AbstractDiffCommand.java	10 Jan 2005 11:51:29 -0000	1.4
  @@ -19,33 +19,36 @@
   import org.apache.maven.scm.CommandParameter;
   import org.apache.maven.scm.CommandParameters;
   import org.apache.maven.scm.ScmException;
  +import org.apache.maven.scm.ScmFileSet;
   import org.apache.maven.scm.ScmResult;
   import org.apache.maven.scm.command.AbstractCommand;
  -import org.apache.maven.scm.repository.ScmRepository;
  +import org.apache.maven.scm.provider.ScmProviderRepository;
   
   import java.io.File;
   
   /**
    * TODO: Better support for entire filesets.
  - * TODO: Better support for entire changesets.
  + * TODO: Better support for entire changesets (ie consistency between revision handling
in CVS and SVN).
  + * TODO: Consistent handling of revisions, tags and dates - currently only revisions supported,
though tags will work for CVS
    *
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  + * @author <a href="mailto:brett@apache.org">Brett Porter</a>
    * @version $Id$
    */
   public abstract class AbstractDiffCommand
       extends AbstractCommand
   {
  -    protected abstract ScmResult executeDiffCommand( ScmRepository repository, File workingDirectory,
String startRevision, String endRevision )
  +    protected abstract DiffScmResult executeDiffCommand( ScmProviderRepository repository,
ScmFileSet fileSet, String startRevision, String endRevision )
           throws ScmException;
   
  -    public ScmResult executeCommand( ScmRepository repository, File workingDirectory, CommandParameters
parameters )
  +    public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
           throws ScmException
       {
           String startRevision = parameters.getString( CommandParameter.START_REVISION );
   
           String endRevision = parameters.getString( CommandParameter.END_REVISION );
   
  -        return executeDiffCommand( repository, workingDirectory, startRevision, endRevision
);
  +        return executeDiffCommand( repository, fileSet, startRevision, endRevision );
       }
   }
  
  
  
  1.1                  maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/DiffScmResult.java
  
  Index: DiffScmResult.java
  ===================================================================
  package org.apache.maven.scm.command.diff;
  
  /*
   * Copyright 2001-2004 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.ScmResult;
  
  /**
   * @todo allow different formats, currently assumes unified diff, include new files
   * @todo probably need to parse command output into individual diffs instead
   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
   * @version $Id: DiffScmResult.java,v 1.1 2005/01/10 11:51:29 brett Exp $
   */
  public class DiffScmResult
      extends ScmResult
  {
      public DiffScmResult( String providerMessage, String commandOutput, boolean success
)
      {
          super( providerMessage, commandOutput, success );
      }
  }
  
  
  
  1.11      +16 -1     maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java
  
  Index: DefaultScmManager.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultScmManager.java	30 Dec 2004 10:05:29 -0000	1.10
  +++ DefaultScmManager.java	10 Jan 2005 11:51:29 -0000	1.11
  @@ -26,6 +26,7 @@
   import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
   import org.apache.maven.scm.command.checkin.CheckInScmResult;
   import org.apache.maven.scm.command.checkout.CheckOutScmResult;
  +import org.apache.maven.scm.command.diff.DiffScmResult;
   import org.apache.maven.scm.command.tag.TagScmResult;
   import org.apache.maven.scm.command.update.UpdateScmResult;
   import org.apache.maven.scm.provider.AbstractScmProvider;
  @@ -176,6 +177,20 @@
           ScmResult scmResult = execute( CommandNameConstants.UPDATE, repository, fileSet,
parameters );
   
           return (UpdateScmResult) checkScmResult( UpdateScmResult.class, scmResult );
  +    }
  +
  +    public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, String startRevision,
String endRevision )
  +        throws ScmException
  +    {
  +        CommandParameters parameters = new CommandParameters();
  +
  +        parameters.setString( CommandParameter.START_REVISION, startRevision );
  +
  +        parameters.setString( CommandParameter.END_REVISION, endRevision );
  +
  +        ScmResult scmResult = execute( CommandNameConstants.DIFF, repository, fileSet,
parameters );
  +
  +        return (DiffScmResult) checkScmResult( DiffScmResult.class, scmResult );
       }
   
       public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet,
Date startDate, Date endDate, int numDays, String branch )
  
  
  
  1.8       +5 -1      maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
  
  Index: ScmManager.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ScmManager.java	4 Jan 2005 09:44:32 -0000	1.7
  +++ ScmManager.java	10 Jan 2005 11:51:29 -0000	1.8
  @@ -22,6 +22,7 @@
   import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
   import org.apache.maven.scm.command.checkin.CheckInScmResult;
   import org.apache.maven.scm.command.checkout.CheckOutScmResult;
  +import org.apache.maven.scm.command.diff.DiffScmResult;
   import org.apache.maven.scm.command.tag.TagScmResult;
   import org.apache.maven.scm.command.update.UpdateScmResult;
   import org.apache.maven.scm.repository.ScmRepository;
  @@ -59,6 +60,9 @@
           throws ScmException;
   
       TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tag )
  +        throws ScmException;
  +
  +    DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, String startRevision,
String endRevision )
           throws ScmException;
   
       ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate,
Date endDate, int numDays, String branch )
  
  
  
  1.6       +2 -2      maven-scm/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java
  
  Index: SvnUpdateCommand.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SvnUpdateCommand.java	24 Dec 2004 03:04:47 -0000	1.5
  +++ SvnUpdateCommand.java	10 Jan 2005 11:51:29 -0000	1.6
  @@ -65,7 +65,7 @@
               return new UpdateScmResult( "The svn command failed.", stderr.getOutput(),
false );
           }
   
  -        return new ScmUpdateScmResult( consumer.getUpdatedFiles(), consumer.getRevision()
);
  +        return new SvnUpdateScmResult( consumer.getUpdatedFiles(), consumer.getRevision()
);
       }
   
       // ----------------------------------------------------------------------
  
  
  
  1.1                  maven-scm/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateScmResult.java
  
  Index: SvnUpdateScmResult.java
  ===================================================================
  package org.apache.maven.scm.provider.svn.command.update;
  
  /*
   * Copyright 2001-2004 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.command.update.UpdateScmResult;
  
  import java.util.List;
  
  /**
   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
   * @version $Id: SvnUpdateScmResult.java,v 1.1 2005/01/10 11:51:29 brett Exp $
   */
  public class SvnUpdateScmResult
      extends UpdateScmResult
  {
      private int revision;
  
      public SvnUpdateScmResult( List updatedFiles, int revision )
      {
          super( updatedFiles );
  
          this.revision = revision;
      }
  
      public int getRevision()
      {
          return revision;
      }
  }
  
  
  
  1.6       +6 -0      maven-scm/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml
  
  Index: components.xml
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- components.xml	4 Jan 2005 09:44:32 -0000	1.5
  +++ components.xml	10 Jan 2005 11:51:29 -0000	1.6
  @@ -33,6 +33,12 @@
   
       <component>
         <role>org.apache.maven.scm.provider.svn.command.SvnCommand</role>
  +      <role-hint>diff</role-hint>
  +      <implementation>org.apache.maven.scm.provider.svn.command.diff.SvnDiffCommand</implementation>
  +    </component>
  +
  +    <component>
  +      <role>org.apache.maven.scm.provider.svn.command.SvnCommand</role>
         <role-hint>tag</role-hint>
         <implementation>org.apache.maven.scm.provider.svn.command.tag.SvnTagCommand</implementation>
       </component>
  
  
  

Mime
View raw message