maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r384262 - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/command/update/ maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/
Date Wed, 08 Mar 2006 16:39:32 GMT
Author: evenisse
Date: Wed Mar  8 08:39:31 2006
New Revision: 384262

URL: http://svn.apache.org/viewcvs?rev=384262&view=rev
Log:
Add in changes list only entries with a date greater than startdate

Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java?rev=384262&r1=384261&r2=384262&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
Wed Mar  8 08:39:31 2006
@@ -30,6 +30,7 @@
 import org.apache.maven.scm.provider.ScmProviderRepository;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -68,9 +69,28 @@
 
             if ( changeLogSet != null )
             {
+                Date startDate = null;
+
+                try
+                {
+                    parameters.getDate( CommandParameter.START_DATE );
+                }
+                catch ( ScmException e )
+                {
+                    //Do nothing, startDate isn't define.
+                }
+
                 for ( Iterator i = changeLogSet.getChangeSets().iterator(); i.hasNext();
)
                 {
                     ChangeSet change = (ChangeSet) i.next();
+
+                    if ( startDate != null )
+                    {
+                        if ( startDate.after( change.getDate() ) )
+                        {
+                            continue;
+                        }
+                    }
 
                     for ( Iterator j = filesList.iterator(); j.hasNext(); )
                     {

Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java?rev=384262&r1=384261&r2=384262&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
(original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.java
Wed Mar  8 08:39:31 2006
@@ -44,6 +44,7 @@
     public void testChangeLogCommand()
         throws Exception
     {
+        Thread.sleep( 1000 );
         ScmProvider provider = getScmManager().getProviderByRepository( getScmRepository()
);
         ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );
 

Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java?rev=384262&r1=384261&r2=384262&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java
(original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java
Wed Mar  8 08:39:31 2006
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.scm.ChangeSet;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmFileStatus;
@@ -27,6 +28,7 @@
 import org.apache.maven.scm.repository.ScmRepository;
 
 import java.io.File;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 import java.util.TreeSet;
@@ -109,6 +111,10 @@
 
         ScmManager scmManager = getScmManager();
 
+        Date lastUpdate = new Date( System.currentTimeMillis() );
+
+        Thread.sleep( 1000 );
+
         commit( getWorkingCopy(), repository );
 
         // ----------------------------------------------------------------------
@@ -116,7 +122,7 @@
         // ----------------------------------------------------------------------
 
         UpdateScmResult result = scmManager.getProviderByUrl( getScmUrl() )
-            .update( repository, new ScmFileSet( getUpdatingCopy() ), null );
+            .update( repository, new ScmFileSet( getUpdatingCopy() ), null, lastUpdate );
 
         assertNotNull( "The command returned a null result.", result );
 
@@ -131,6 +137,12 @@
         assertNotNull( "The changed files list is null", changedFiles );
 
         assertFalse( "The changed files list is empty", changedFiles.isEmpty() );
+
+        for ( Iterator i = changedFiles.iterator(); i.hasNext(); )
+        {
+            ChangeSet changeSet = (ChangeSet) i.next();
+            System.out.println( changeSet.toXML() );
+        }
 
         // ----------------------------------------------------------------------
         // Assert the files in the updated files list



Mime
View raw message