maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r371543 - in /maven/scm/trunk: maven-scm-api/src/main/java/org/apache/maven/scm/ maven-scm-api/src/main/java/org/apache/maven/scm/command/update/ maven-scm-managers/ maven-scm-managers/maven-scm-manager-plexus/ maven-scm-plugin/ maven-scm-p...
Date Mon, 23 Jan 2006 14:26:08 GMT
Author: evenisse
Date: Mon Jan 23 06:25:55 2006
New Revision: 371543

URL: http://svn.apache.org/viewcvs?rev=371543&view=rev
Log:
[SCM-126] Fix change set initialization that didn't work for svn.

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.java
  (with props)
Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java
    maven/scm/trunk/maven-scm-managers/   (props changed)
    maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/   (props changed)
    maven/scm/trunk/maven-scm-plugin/   (props changed)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.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/ChangeSet.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java?rev=371543&r1=371542&r2=371543&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java Mon Jan
23 06:25:55 2006
@@ -1,12 +1,5 @@
 package org.apache.maven.scm;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
 /*
  * Copyright 2001-2005 The Apache Software Foundation.
  *
@@ -23,6 +16,15 @@
  * limitations under the License.
  */
 
+import org.apache.maven.scm.provider.ScmProviderRepository;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -111,7 +113,7 @@
         files.add( file );
     }
 
-    public boolean containsFilename( String filename )
+    public boolean containsFilename( String filename, ScmProviderRepository repository )
     {
         if ( files != null )
         {

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=371543&r1=371542&r2=371543&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
Mon Jan 23 06:25:55 2006
@@ -75,7 +75,7 @@
                     {
                         ScmFile currentFile = (ScmFile) j.next();
 
-                        if ( change.containsFilename( currentFile.getPath() ) )
+                        if ( change.containsFilename( currentFile.getPath(), repository )
)
                         {
                             changes.add( change );
                         }

Propchange: maven/scm/trunk/maven-scm-managers/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jan 23 06:25:55 2006
@@ -0,0 +1 @@
+maven-scm-managers.iml

Propchange: maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jan 23 06:25:55 2006
@@ -2,3 +2,4 @@
 .project
 target
 .wtpmodules
+maven-scm-manager-plexus.iml

Propchange: maven/scm/trunk/maven-scm-plugin/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jan 23 06:25:55 2006
@@ -2,3 +2,4 @@
 .classpath
 .project
 .wtpmodules
+maven-scm-plugin.iml

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.java?rev=371543&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.java
Mon Jan 23 06:25:55 2006
@@ -0,0 +1,61 @@
+package org.apache.maven.scm.provider.svn;
+
+import org.apache.maven.scm.ChangeFile;
+import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+
+import java.util.Iterator;
+
+/*
+ * Copyright 2001-2005 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class SvnChangeSet
+    extends ChangeSet
+{
+    public boolean containsFilename( String filename, ScmProviderRepository repository )
+    {
+        SvnScmProviderRepository repo = (SvnScmProviderRepository) repository;
+
+        String url = repo.getUrl();
+
+        if ( !url.endsWith( "/" ) )
+        {
+            url += "/";
+        }
+
+        String currentFile = url + filename;
+
+        if ( getFiles() != null )
+        {
+            for ( Iterator i = getFiles().iterator(); i.hasNext(); )
+            {
+                ChangeFile file = (ChangeFile) i.next();
+
+                if ( currentFile.endsWith( file.getName() ) )
+                {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java?rev=371543&r1=371542&r2=371543&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java
Mon Jan 23 06:25:55 2006
@@ -17,7 +17,7 @@
  */
 
 import org.apache.maven.scm.ChangeFile;
-import org.apache.maven.scm.ChangeSet;
+import org.apache.maven.scm.provider.svn.SvnChangeSet;
 import org.apache.regexp.RE;
 import org.apache.regexp.RESyntaxException;
 import org.codehaus.plexus.util.cli.StreamConsumer;
@@ -104,7 +104,7 @@
     /**
      * The current log entry being processed by the parser
      */
-    private ChangeSet currentChange;
+    private SvnChangeSet currentChange;
 
     /**
      * The current revision of the entry being processed by the parser
@@ -197,7 +197,7 @@
 
         currentRevision = headerRegexp.getParen( 1 );
 
-        currentChange = new ChangeSet();
+        currentChange = new SvnChangeSet();
 
         currentChange.setAuthor( headerRegexp.getParen( 2 ) );
 

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=371543&r1=371542&r2=371543&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
Mon Jan 23 06:25:55 2006
@@ -226,6 +226,8 @@
 
         assertNotNull( "The changed files list is null", changedFiles );
 
+        assertFalse( "The changed files list is empty", changedFiles.isEmpty() );
+
         // ----------------------------------------------------------------------
         // Assert the files in the updated files list
         // ----------------------------------------------------------------------



Mime
View raw message