maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r290941 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src: main/java/org/apache/maven/scm/provider/cvslib/ main/java/org/apache/maven/scm/provider/cvslib/command/login/ main/java/org/apache/maven/scm/provider/cvslib/repos...
Date Thu, 22 Sep 2005 13:28:30 GMT
Author: evenisse
Date: Thu Sep 22 06:28:20 2005
New Revision: 290941

URL: http://svn.apache.org/viewcvs?rev=290941&view=rev
Log:
Fix cvs url parsing with port.

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java?rev=290941&r1=290940&r2=290941&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java
Thu Sep 22 06:28:20 2005
@@ -353,16 +353,22 @@
                 module = tokens[4];
             }
 
-            String userHostPort = host;
+            String userHost = host;
+
             if ( user != null )
             {
-                userHostPort = user + "@" + host;
+                userHost = user + "@" + host;
             }
+
+            // cvsroot format is :pserver:[user@]host:[port]path
+            cvsroot = ":" + transport + ":" + userHost + ":";
+
             if ( port != -1 )
             {
-                userHostPort += ":" + port;
+                cvsroot += port;
             }
-            cvsroot = ":" + transport + ":" + userHostPort + ":" + path;
+
+            cvsroot += path;
         }
         else
         {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.java?rev=290941&r1=290940&r2=290941&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.java
Thu Sep 22 06:28:20 2005
@@ -49,7 +49,7 @@
 
         CvsPass passGenerator = new CvsPass( getLogger() );
 
-        passGenerator.setCvsroot( repo.getCvsRootForCvsPass() );
+        passGenerator.setCvsroot( repo.getCvsRoot() );
 
         passGenerator.setPassword( repo.getPassword() );
         try

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java?rev=290941&r1=290940&r2=290941&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
Thu Sep 22 06:28:20 2005
@@ -73,11 +73,6 @@
         return cvsroot;
     }
 
-    public String getCvsRootForCvsPass()
-    {
-        return ":" + transport + ":" + getUser() + "@" + host + ":" + port + path;
-    }
-
     /**
      * @return The subtype (like pserver).
      */

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java?rev=290941&r1=290940&r2=290941&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java
Thu Sep 22 06:28:20 2005
@@ -74,9 +74,7 @@
 
         assertEquals( "/home/cvspublic", repo.getPath() );
 
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401:/home/cvspublic", repo.getCvsRoot()
);
-
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass()
);
+        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRoot()
);
     }
 
     public void testParseRemotePserverConnectionWithPort()
@@ -96,9 +94,7 @@
 
         assertEquals( 2401, repo.getPort() );
 
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401:/home/cvspublic", repo.getCvsRoot()
);
-
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass()
);
+        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRoot()
);
     }
 
     public void testParseRemotePserverConnectionWithPassword()
@@ -118,9 +114,7 @@
 
         assertEquals( "/home/cvspublic", repo.getPath() );
 
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401:/home/cvspublic", repo.getCvsRoot()
);
-
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass()
);
+        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRoot()
);
     }
 
     public void testParseRemotePserverConnectionWithPortAndPassword()
@@ -142,9 +136,7 @@
 
         assertEquals( 2401, repo.getPort() );
 
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401:/home/cvspublic", repo.getCvsRoot()
);
-
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass()
);
+        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRoot()
);
     }
 
     public void testParseRemotePserverConnectionWithBarsAsDelimiter()
@@ -162,9 +154,7 @@
 
         assertEquals( "/home/cvspublic", repo.getPath() );
 
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401:/home/cvspublic", repo.getCvsRoot()
);
-
-        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass()
);
+        assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRoot()
);
     }
 
     public void testIllegalRepository()



Mime
View raw message