You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Dennis Lundberg <de...@mdh.se> on 2006/01/19 20:39:59 UTC

Re: svn commit: r370407 - in /maven/maven-1/plugins/trunk/xdoc/src: main/org/apache/maven/xdoc/util/ScmUtil.java plugin-resources/templates/cvs-usage.xml

Lukas

You should use the same separator in the new scm url as was used in the 
original. The separator can be either ":" or "|". See below:

-- 
Dennis Lundberg

ltheussl@apache.org wrote:
> Author: ltheussl
> Date: Wed Jan 18 23:40:58 2006
> New Revision: 370407
> 
> URL: http://svn.apache.org/viewcvs?rev=370407&view=rev
> Log:
> Fix cvs connection string
> 
> Modified:
>     maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java
>     maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/templates/cvs-usage.xml
> 
> Modified: maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java
> URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java?rev=370407&r1=370406&r2=370407&view=diff
> ==============================================================================
> --- maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java (original)
> +++ maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java Wed Jan 18 23:40:58 2006
> @@ -119,6 +119,39 @@
>      }
>  
>      /**
> +     * Get cvs connection string. Used in xdocs/src/plugin-resources/templates/cvs-usage.xml.
> +     * If username == "", assumes anonymous (pserver) connection. In this case,
> +     * inserts a ':' between the username and '@' to indicate
> +     * that there is a password and that it is empty.
> +     * If username != "" it replaces username in conn.
> +     * 
> +     * @param conn six token connection string
> +     * @param username username override if non-empty.
> +     * @return CVS root.
> +     */
> +    public String getCvsConnection(String conn, String username)
> +    {
> +        String[] tokens = splitSCMConnection(conn);
> +
> +        if (!tokens[1].equals("cvs"))
> +        {
> +            return "";
> +        }
> +
> +        if (tokens[3].indexOf('@') >= 0)
> +        {
> +            if (username.length() == 0)
> +            {
> +                username = tokens[3].substring(0, tokens[3].indexOf('@')) + ":";
> +            }
> +            tokens[3] = username + "@" + tokens[3].substring(tokens[3].indexOf('@') + 1);
> +        }

+        // The length of conn has already been checked in the call to
+        // splitSCMConnection(conn) above, so it's OK to just extract
+        // the char.
+        String separator = "" + conn.charAt(3);
+        String result = tokens[0] + separator + tokens[1] + separator + 
tokens[2] + separator + tokens[3] + separator + tokens[4] + separator + 
tokens[5];

> +        String result = tokens[0] + ":" + tokens[1] + ":" + tokens[2] + ":" + tokens[3]
> +            + ":" + tokens[4] + ":" + tokens[5];
> +        return result;
> +    }
> +
> +    /**
>       * Get cvs module. Used in
>       * xdocs/src/plugin-resources/templates/cvs-usage.xml.
>       * 
> 

<snip>

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


Re: svn commit: r370407 - in /maven/maven-1/plugins/trunk/xdoc/src: main/org/apache/maven/xdoc/util/ScmUtil.java plugin-resources/templates/cvs-usage.xml

Posted by Lukas Theussl <lt...@apache.org>.
Fixed. Thanks!

-Lukas


Dennis Lundberg wrote:
> Lukas
> 
> You should use the same separator in the new scm url as was used in the 
> original. The separator can be either ":" or "|". See below:
> 

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