Author: ltheussl
Date: Tue Dec 19 16:09:04 2006
New Revision: 488860

URL: http://svn.apache.org/viewvc?view=rev&rev=488860
Log:
PR: MPCHANGELOG-89
Plugin fails with anonymous access and empty password in scm url.

Modified:
    
maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/util/RepositoryUtils.java
    
maven/maven-1/plugins/trunk/changelog/src/test/org/apache/maven/util/RepositoryTest.java
    maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml

Modified: 
maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/util/RepositoryUtils.java
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/util/RepositoryUtils.java?view=diff&rev=488860&r1=488859&r2=488860
==============================================================================
--- 
maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/util/RepositoryUtils.java
 (original)
+++ 
maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/util/RepositoryUtils.java
 Tue Dec 19 16:09:04 2006
@@ -120,8 +120,19 @@
                         "cvs local repository connection string doesn't 
contain five tokens" );
                 }
             }
+            else if ( ( tokens.length == 7 ) && tokens[2].equals( "pserver" ) 
&& tokens[4].startsWith("@"))
+            {
+                String[] newTokens = new String[6];
 
-            if ( tokens.length != 6 )
+                newTokens[0] = tokens[0];
+                newTokens[1] = tokens[1];
+                newTokens[2] = tokens[2];
+                newTokens[3] = tokens[3] + tokens[4];
+                newTokens[4] = tokens[5];
+                newTokens[5] = tokens[6];
+                tokens = newTokens;
+            }
+            else if ( tokens.length != 6 )
             {
                 throw new IllegalArgumentException( 
                     "cvs repository connection string doesn't contain six 
tokens" );

Modified: 
maven/maven-1/plugins/trunk/changelog/src/test/org/apache/maven/util/RepositoryTest.java
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/changelog/src/test/org/apache/maven/util/RepositoryTest.java?view=diff&rev=488860&r1=488859&r2=488860
==============================================================================
--- 
maven/maven-1/plugins/trunk/changelog/src/test/org/apache/maven/util/RepositoryTest.java
 (original)
+++ 
maven/maven-1/plugins/trunk/changelog/src/test/org/apache/maven/util/RepositoryTest.java
 Tue Dec 19 16:09:04 2006
@@ -43,6 +43,13 @@
         assertEquals("Wrong number of tokens split", 6, tokens.length);
     }
 
+    public void testSplitScmConnectionEmptyPassword()
+    {
+        String con = 
"scm:cvs:pserver:anoncvs:@cvs.apache.org:/cvs/root:module";
+        String[] tokens = RepositoryUtils.splitSCMConnection(con);
+        assertEquals("Empty password should be ignored", "[EMAIL PROTECTED]", 
tokens[3]);
+    }
+
     public void testSplitScmConnectionCvsLocal5Tokens()
     {
         String con = "scm:cvs:local:/cvs/root:module";

Modified: maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml?view=diff&rev=488860&r1=488859&r2=488860
==============================================================================
--- maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml Tue Dec 19 16:09:04 
2006
@@ -25,6 +25,7 @@
   </properties>
   <body>
     <release version="1.10-SNAPSHOT" date="In SVN">
+      <action dev="ltheussl" type="fix" issue="MPCHANGELOG-89">Plugin fails 
with anonymous access and empty password in scm url.</action>
       <action dev="aheritier" type="update" issue="MAVEN-1769">Upgrade 
maven-model to version 3.0.2</action>
       <action dev="ltheussl" type="add">New property 
<code>maven.changelog.useDeveloperConnection</code>.</action>
       <action dev="ltheussl" type="add" issue="MPCHANGELOG-86" 
due-to="Christoph Jerolimov">Support time period in MKS changelog 
parser.</action>


Reply via email to