You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2006/01/19 22:47:52 UTC

svn commit: r370646 - in /maven/maven-1/plugins/trunk/changelog: src/main/org/apache/maven/changelog/ChangeLog.java xdocs/changes.xml

Author: ltheussl
Date: Thu Jan 19 13:47:50 2006
New Revision: 370646

URL: http://svn.apache.org/viewcvs?rev=370646&view=rev
Log:
PR: MPCHANGELOG-72
Submitted by: Pascal Larin
Auto select factory from connection doesn't work if
provider name length different from 3.

Modified:
    maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java
    maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml

Modified: maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java?rev=370646&r1=370645&r2=370646&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java (original)
+++ maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java Thu Jan 19 13:47:50 2006
@@ -503,15 +503,22 @@
     {
         if ( clFactoryClass == null )
         {
-            if ( ( connection == null ) || ( connection.length() < 7 )
+            //Connection Format: scm:<provider>[:<provider specific connection string>]
+            if ( ( connection == null ) || ( connection.length() < 5 )
                 || !connection.startsWith( "scm:" ) )
             {
                 LOG.warn( "Connection does not appear valid" );
             }
             else
             {
-                clFactoryClass =
-                    (String) FACTORIES.get( connection.substring( 4, 7 ) );
+                int iProviderEnd = connection.indexOf( ":", 4 );
+                if ( iProviderEnd == -1 )
+                {
+                    // Connection = scm:<provider>
+                    iProviderEnd = connection.length();
+                }
+
+                clFactoryClass = (String) FACTORIES.get( connection.substring( 4, iProviderEnd ) );
             }
 
             if ( clFactoryClass == null )

Modified: maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml?rev=370646&r1=370645&r2=370646&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml Thu Jan 19 13:47:50 2006
@@ -25,6 +25,7 @@
   </properties>
   <body>
     <release version="1.9-SNAPSHOT" date="in SVN">
+      <action dev="ltheussl" type="fix" issue="MPCHANGELOG-72" due-to="Pascal Larin">Auto select factory from connection doesn't work if provider name length different from 3.</action>
       <action dev="ltheussl" type="add" issue="MPCHANGELOG-80" due-to="Christoph Jerolimov">Add MKS SI support.</action>
       <action dev="ltheussl" type="fix" issue="MPCHANGELOG-69">Changelog returns 0 entries on Windows with CVS (not CVSNT). New property <code>maven.changelog.quoteDate</code>.</action>
       <action dev="ltheussl" type="fix" issue="MPCHANGELOG-74">Changelog plugin creates wrong links for Subversion repositories. New property <code>maven.changelog.svn.baseurl</code>.</action>



Re: svn commit: r370646 - in /maven/maven-1/plugins/trunk/changelog: src/main/org/apache/maven/changelog/ChangeLog.java xdocs/changes.xml

Posted by Lukas Theussl <lt...@apache.org>.

> 
> I'll supply a patch for this tomorrow.
> Should I put it in JIRA?
> 

Yes please, like that we can track it.

thanks!
Lukas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r370646 - in /maven/maven-1/plugins/trunk/changelog: src/main/org/apache/maven/changelog/ChangeLog.java xdocs/changes.xml

Posted by Dennis Lundberg <de...@mdh.se>.
Actually, one of the problems, the most pressing one, was introduced by 
his patch:

-                clFactoryClass =
-                    (String) FACTORIES.get( connection.substring( 4, 7 ) );
+                int iProviderEnd = connection.indexOf( ":", 4 );
+                if ( iProviderEnd == -1 )
+                {
+                    // Connection = scm:<provider>
+                    iProviderEnd = connection.length();
+                }
+
+                clFactoryClass = (String) FACTORIES.get( 
connection.substring( 4, iProviderEnd ) );


I'll supply a patch for this tomorrow.
Should I put it in JIRA?

-- 
Dennis Lundberg


Lukas Theussl wrote:
> Dennis,
> 
> You are right, but this is not a bug introduced by the current patch 
> which deals with a different issue. The ':' was there before already, 
> this should be corrected separately and consistently (I haven't checked 
> where else the colon is hardcoded). Want to submit a patch? :)
> 
> -Lukas
> 
> 
> Dennis Lundberg wrote:
>> This change does not work if the scm url is using "|" as separator 
>> instead of ":". See more below...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r370646 - in /maven/maven-1/plugins/trunk/changelog: src/main/org/apache/maven/changelog/ChangeLog.java xdocs/changes.xml

Posted by Lukas Theussl <lt...@apache.org>.
Dennis,

You are right, but this is not a bug introduced by the current patch 
which deals with a different issue. The ':' was there before already, 
this should be corrected separately and consistently (I haven't checked 
where else the colon is hardcoded). Want to submit a patch? :)

-Lukas


Dennis Lundberg wrote:
> This change does not work if the scm url is using "|" as separator 
> instead of ":". See more below...


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r370646 - in /maven/maven-1/plugins/trunk/changelog: src/main/org/apache/maven/changelog/ChangeLog.java xdocs/changes.xml

Posted by Dennis Lundberg <de...@mdh.se>.
This change does not work if the scm url is using "|" as separator 
instead of ":". See more below...

ltheussl@apache.org wrote:
> Author: ltheussl
> Date: Thu Jan 19 13:47:50 2006
> New Revision: 370646
> 
> URL: http://svn.apache.org/viewcvs?rev=370646&view=rev
> Log:
> PR: MPCHANGELOG-72
> Submitted by: Pascal Larin
> Auto select factory from connection doesn't work if
> provider name length different from 3.
> 
> Modified:
>     maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java
>     maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml
> 
> Modified: maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java
> URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java?rev=370646&r1=370645&r2=370646&view=diff
> ==============================================================================
> --- maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java (original)
> +++ maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java Thu Jan 19 13:47:50 2006
> @@ -503,15 +503,22 @@
>      {
>          if ( clFactoryClass == null )
>          {
> -            if ( ( connection == null ) || ( connection.length() < 7 )
> +            //Connection Format: scm:<provider>[:<provider specific connection string>]
> +            if ( ( connection == null ) || ( connection.length() < 5 )

This line might cause problems in the future. Upcoming versions of 
maven-scm will allow a scm url to start with "scm|" as well as "scm:".

>                  || !connection.startsWith( "scm:" ) )
>              {
>                  LOG.warn( "Connection does not appear valid" );
>              }
>              else
>              {
> -                clFactoryClass =
> -                    (String) FACTORIES.get( connection.substring( 4, 7 ) );

The line below will return -1 if is no ":" after position 3.

> +                int iProviderEnd = connection.indexOf( ":", 4 );
> +                if ( iProviderEnd == -1 )
> +                {
> +                    // Connection = scm:<provider>

If that is the case, then this line will be executed...

> +                    iProviderEnd = connection.length();
> +                }
> +

... and this line will fail, because it returns everything after "scm:".

> +                clFactoryClass = (String) FACTORIES.get( connection.substring( 4, iProviderEnd ) );
>              }
>  
>              if ( clFactoryClass == null )
> 
> Modified: maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml
> URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml?rev=370646&r1=370645&r2=370646&view=diff
> ==============================================================================
> --- maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml (original)
> +++ maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml Thu Jan 19 13:47:50 2006
> @@ -25,6 +25,7 @@
>    </properties>
>    <body>
>      <release version="1.9-SNAPSHOT" date="in SVN">
> +      <action dev="ltheussl" type="fix" issue="MPCHANGELOG-72" due-to="Pascal Larin">Auto select factory from connection doesn't work if provider name length different from 3.</action>
>        <action dev="ltheussl" type="add" issue="MPCHANGELOG-80" due-to="Christoph Jerolimov">Add MKS SI support.</action>
>        <action dev="ltheussl" type="fix" issue="MPCHANGELOG-69">Changelog returns 0 entries on Windows with CVS (not CVSNT). New property <code>maven.changelog.quoteDate</code>.</action>
>        <action dev="ltheussl" type="fix" issue="MPCHANGELOG-74">Changelog plugin creates wrong links for Subversion repositories. New property <code>maven.changelog.svn.baseurl</code>.</action>
> 
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org