maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1332386 - /maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
Date Mon, 30 Apr 2012 21:01:25 GMT
Author: struberg
Date: Mon Apr 30 21:01:24 2012
New Revision: 1332386

URL: http://svn.apache.org/viewvc?rev=1332386&view=rev
Log:
MRELEASE-740 fix a few problens on Windows

thanks to Florent Paillard for the patch. Applied with slight changes. 

Modified:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java?rev=1332386&r1=1332385&r2=1332386&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
Mon Apr 30 21:01:24 2012
@@ -85,7 +85,13 @@ public class CheckoutProjectFromScm
             {
                 try
                 {
-                    String scmUrl = providerPart + ":file://" + scmPath;
+                    if ( scmPath.startsWith("/") )
+                    {
+                        // cut off the first '/'
+                        scmPath = scmPath.substring( 1 );
+                    }
+
+                    String scmUrl = providerPart + ":file:///" + scmPath;
                     releaseDescriptor.setScmSourceUrl( scmUrl );
                     getLogger().info( "Performing a LOCAL checkout from " + releaseDescriptor.getScmSourceUrl()
);
 
@@ -104,7 +110,7 @@ public class CheckoutProjectFromScm
                     releaseResult = null;
 
                     // remove last sub-directory path
-                    int lastSlashPos = scmPath.lastIndexOf( "/" );
+                    int lastSlashPos = scmPath.lastIndexOf( File.separator );
                     if ( lastSlashPos > 0 )
                     {
                         scmPath = scmPath.substring( 0, lastSlashPos );



Mime
View raw message