Author: olamy Date: Wed Mar 18 22:31:22 2009 New Revision: 755760 URL: http://svn.apache.org/viewvc?rev=755760&view=rev Log: upgrade to 1.2-SNAPSHOT and implements new method in svnjava
Modified: maven/sandbox/trunk/scm/maven-scm-provider-starteamtest/pom.xml maven/sandbox/trunk/scm/maven-scm-provider-svnjava/pom.xml maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/SvnJavaUtil.java maven/sandbox/trunk/scm/pom.xml Modified: maven/sandbox/trunk/scm/maven-scm-provider-starteamtest/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/scm/maven-scm-provider-starteamtest/pom.xml?rev=755760&r1=755759&r2=755760&view=diff ============================================================================== --- maven/sandbox/trunk/scm/maven-scm-provider-starteamtest/pom.xml (original) +++ maven/sandbox/trunk/scm/maven-scm-provider-starteamtest/pom.xml Wed Mar 18 22:31:22 2009 @@ -1,53 +1,53 @@ -<?xml version="1.0" encoding="UTF-8"?><!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <artifactId>maven-scm-providers</artifactId> - <groupId>org.apache.maven.scm</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <artifactId>maven-scm-provider-starteamtest</artifactId> - <name>Maven SCM Starteam Provider TCK tests</name> - <version>1.0-SNAPSHOT</version> - <dependencies> - <dependency> - <groupId>org.apache.maven.scm</groupId> - <artifactId>maven-scm-test</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.maven.scm</groupId> - <artifactId>maven-scm-provider-starteam</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>com.borland.starteam</groupId> - <artifactId>starteam</artifactId> - <version>2005-R2</version> - </dependency> - <dependency> - <groupId>com.borland.starteam</groupId> - <artifactId>ss</artifactId> - <version>2005-R2</version> - </dependency> - </dependencies> -</project> +<?xml version="1.0" encoding="UTF-8"?><!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <parent> + <artifactId>maven-scm-providers</artifactId> + <groupId>org.apache.maven.scm</groupId> + <version>1.2-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>maven-scm-provider-starteamtest</artifactId> + <name>Maven SCM Starteam Provider TCK tests</name> + <version>1.2-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.scm</groupId> + <artifactId>maven-scm-test</artifactId> + <version>1.2-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.maven.scm</groupId> + <artifactId>maven-scm-provider-starteam</artifactId> + <version>1.2-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>com.borland.starteam</groupId> + <artifactId>starteam</artifactId> + <version>2005-R2</version> + </dependency> + <dependency> + <groupId>com.borland.starteam</groupId> + <artifactId>ss</artifactId> + <version>2005-R2</version> + </dependency> + </dependencies> +</project> Modified: maven/sandbox/trunk/scm/maven-scm-provider-svnjava/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/scm/maven-scm-provider-svnjava/pom.xml?rev=755760&r1=755759&r2=755760&view=diff ============================================================================== --- maven/sandbox/trunk/scm/maven-scm-provider-svnjava/pom.xml (original) +++ maven/sandbox/trunk/scm/maven-scm-provider-svnjava/pom.xml Wed Mar 18 22:31:22 2009 @@ -23,9 +23,9 @@ <modelVersion>4.0.0</modelVersion> <parent> - <artifactId>maven-scm-providers-svn</artifactId> <groupId>org.apache.maven.scm</groupId> - <version>1.1.1-SNAPSHOT</version> + <artifactId>maven-scm-providers-svn</artifactId> + <version>1.2-SNAPSHOT</version> </parent> <artifactId>maven-scm-provider-svnjava</artifactId> Modified: maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java?rev=755760&r1=755759&r2=755760&view=diff ============================================================================== --- maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java (original) +++ maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/command/tag/SvnTagCommand.java Wed Mar 18 22:31:22 2009 @@ -25,6 +25,7 @@ import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTag; +import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; @@ -59,6 +60,13 @@ String message ) throws ScmException { + return executeTagCommand( repo, fileSet, tag, new ScmTagParameters(message) ); + } + + protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, + ScmTagParameters scmTagParameters ) + throws ScmException + { if ( tag == null ) { throw new ScmException( "tag must be specified" ); @@ -80,17 +88,16 @@ try { - SVNURL destURL = - SVNURL.parseURIEncoded( SvnTagBranchUtils.resolveTagUrl( repository, new ScmTag( tag ) ) ); + SVNURL destURL = SVNURL.parseURIEncoded( SvnTagBranchUtils.resolveTagUrl( repository, new ScmTag( tag ) ) ); - SVNCommitInfo info = - SvnJavaUtil.copy( javaRepo.getClientManager(), javaRepo.getSvnUrl(), destURL, false, - "[maven-scm] copy for tag " + tag ); + SVNCommitInfo info = SvnJavaUtil + .copy( javaRepo.getClientManager(), javaRepo.getSvnUrl(), destURL, false, "[maven-scm] copy for tag " + + tag, scmTagParameters.getScmRevision() ); if ( info.getError() != null ) { - return new TagScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN tag failed.", - info.getError().getMessage(), false ); + return new TagScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN tag failed.", info.getError() + .getMessage(), false ); } // The copy command doesn't return a list of files that were tagged, @@ -119,4 +126,5 @@ return new TagScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN tag failed.", e.getMessage(), false ); } } + } Modified: maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/SvnJavaUtil.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/SvnJavaUtil.java?rev=755760&r1=755759&r2=755760&view=diff ============================================================================== --- maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/SvnJavaUtil.java (original) +++ maven/sandbox/trunk/scm/maven-scm-provider-svnjava/src/main/java/org/apache/maven/scm/provider/svn/svnjava/util/SvnJavaUtil.java Wed Mar 18 22:31:22 2009 @@ -355,51 +355,65 @@ isCollectParentExternals, handler ); } + /* - * Duplicates srcURL to dstURL (URL->URL)in a repository remembering history. - * Like 'svn copy srcURL dstURL -m "some comment"' command. It's done by - * invoking - * - * doCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, - * boolean isMove, String commitMessage) - * - * which takes the following parameters: - * - * srcURL - a source URL that is to be copied; - * - * srcRevision - a definite revision of srcURL - * - * dstURL - a URL where srcURL will be copied; if srcURL & dstURL are both - * directories then there are two cases: - * a) dstURL already exists - then doCopy(..) will duplicate the entire source - * directory and put it inside dstURL (for example, - * consider srcURL = svn://localhost/rep/MyRepos, - * dstURL = svn://localhost/rep/MyReposCopy, in this case if doCopy(..) succeeds - * MyRepos will be in MyReposCopy - svn://localhost/rep/MyReposCopy/MyRepos); - * b) dstURL doesn't exist yet - then doCopy(..) will create a directory and - * recursively copy entries from srcURL into dstURL (for example, consider the same - * srcURL = svn://localhost/rep/MyRepos, dstURL = svn://localhost/rep/MyReposCopy, - * in this case if doCopy(..) succeeds MyRepos entries will be in MyReposCopy, like: - * svn://localhost/rep/MyRepos/Dir1 -> svn://localhost/rep/MyReposCopy/Dir1...); - * - * isMove - if false then srcURL is only copied to dstURL what - * corresponds to 'svn copy srcURL dstURL -m "some comment"'; but if it's true then - * srcURL will be copied and deleted - 'svn move srcURL dstURL -m "some comment"'; - * - * commitMessage - a commit log message since URL->URL copying is immediately - * committed to a repository. - */ - public static SVNCommitInfo copy( SVNClientManager clientManager, SVNURL srcURL, SVNURL dstURL, - boolean isMove, String commitMessage ) + * Duplicates srcURL to dstURL (URL->URL)in a repository remembering history. + * Like 'svn copy srcURL dstURL -m "some comment"' command. It's done by + * invoking + * + * doCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, + * boolean isMove, String commitMessage) + * + * which takes the following parameters: + * + * srcURL - a source URL that is to be copied; + * + * srcRevision - a definite revision of srcURL + * + * dstURL - a URL where srcURL will be copied; if srcURL & dstURL are both + * directories then there are two cases: + * a) dstURL already exists - then doCopy(..) will duplicate the entire source + * directory and put it inside dstURL (for example, + * consider srcURL = svn://localhost/rep/MyRepos, + * dstURL = svn://localhost/rep/MyReposCopy, in this case if doCopy(..) succeeds + * MyRepos will be in MyReposCopy - svn://localhost/rep/MyReposCopy/MyRepos); + * b) dstURL doesn't exist yet - then doCopy(..) will create a directory and + * recursively copy entries from srcURL into dstURL (for example, consider the same + * srcURL = svn://localhost/rep/MyRepos, dstURL = svn://localhost/rep/MyReposCopy, + * in this case if doCopy(..) succeeds MyRepos entries will be in MyReposCopy, like: + * svn://localhost/rep/MyRepos/Dir1 -> svn://localhost/rep/MyReposCopy/Dir1...); + * + * isMove - if false then srcURL is only copied to dstURL what + * corresponds to 'svn copy srcURL dstURL -m "some comment"'; but if it's true then + * srcURL will be copied and deleted - 'svn move srcURL dstURL -m "some comment"'; + * + * commitMessage - a commit log message since URL->URL copying is immediately + * committed to a repository. + * + * revision the revision to use if null SVNRevision.HEAD will be used + * + */ + public static SVNCommitInfo copy( SVNClientManager clientManager, SVNURL srcURL, SVNURL dstURL, boolean isMove, + String commitMessage, String revision ) throws SVNException { + + SVNRevision svnRevision = null; + if ( revision == null ) + { + svnRevision = SVNRevision.HEAD; + } + else + { + svnRevision = SVNRevision.create( Long.parseLong( revision ) ); + } /* * SVNRevision.HEAD means the latest revision. * Returns SVNCommitInfo containing information on the new revision committed * (revision number, etc.) */ - return clientManager.getCopyClient().doCopy( srcURL, SVNRevision.HEAD, dstURL, isMove, commitMessage ); - } + return clientManager.getCopyClient().doCopy( srcURL, svnRevision, dstURL, isMove, commitMessage ); + } public static ByteArrayOutputStream diff( SVNClientManager clientManager, File baseDir, SVNRevision startRevision, SVNRevision endRevision ) Modified: maven/sandbox/trunk/scm/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/scm/pom.xml?rev=755760&r1=755759&r2=755760&view=diff ============================================================================== --- maven/sandbox/trunk/scm/pom.xml (original) +++ maven/sandbox/trunk/scm/pom.xml Wed Mar 18 22:31:22 2009 @@ -24,7 +24,7 @@ <parent> <artifactId>maven-scm</artifactId> <groupId>org.apache.maven.scm</groupId> - <version>1.0-SNAPSHOT</version> + <version>1.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>maven-scm-sandbox</artifactId> @@ -33,6 +33,6 @@ <version>1.0-SNAPSHOT</version> <modules> <module>maven-scm-provider-svnjava</module> - <module>maven-scm-provider-cvsjava</module> + <module>maven-scm-provider-starteamtest</module> </modules> -</project> \ No newline at end of file +</project>