maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1075582 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src: main/java/org/apache/maven/scm/provider/accurev/ main/java/org/apache/maven/scm/provider/accurev/cli/ main/java/org/apache/maven/scm/provider/accurev/command...
Date Mon, 28 Feb 2011 23:16:58 GMT
Author: olamy
Date: Mon Feb 28 23:16:57 2011
New Revision: 1075582

URL: http://svn.apache.org/viewvc?rev=1075582&view=rev
Log:
[SCM-611] AccuRev - call replica sync before export
Submitted by Grant Gardner

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRev.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLine.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/ErrorConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommandTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRev.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRev.java?rev=1075582&r1=1075581&r2=1075582&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRev.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRev.java
Mon Feb 28 23:16:57 2011
@@ -282,4 +282,7 @@ public interface AccuRev
     String getClientVersion()
         throws AccuRevException;
 
+    boolean  syncReplica()
+        throws AccuRevException;
+
 }
\ No newline at end of file

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLine.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLine.java?rev=1075582&r1=1075581&r2=1075582&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLine.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/AccuRevCommandLine.java
Mon Feb 28 23:16:57 2011
@@ -744,4 +744,10 @@ public class AccuRevCommandLine
 
     }
 
+    public boolean syncReplica()
+        throws AccuRevException
+    {
+        return executeCommandLine( new String[] { "replica", "sync" } );
+    }
+
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/ErrorConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/ErrorConsumer.java?rev=1075582&r1=1075581&r2=1075582&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/ErrorConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/cli/ErrorConsumer.java
Mon Feb 28 23:16:57 2011
@@ -29,6 +29,7 @@ final class ErrorConsumer
 {
 
     private static final Pattern[] SKIPPED_WARNINGS = {
+        Pattern.compile( ".*replica sync on the master server.*"),
         Pattern.compile( "No elements selected.*" ),
         Pattern.compile( "You are not in a directory.*" ),
         Pattern.compile( "Note.*" ),

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommand.java?rev=1075582&r1=1075581&r2=1075582&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommand.java
Mon Feb 28 23:16:57 2011
@@ -72,6 +72,9 @@ public class AccuRevExportCommand
                               String.format( "Ignoring transaction id %s, Export can only
extract current sources",
                                              transactionId ) );
             transactionId = "now";
+        } else {
+            //We might be heading to a transaction id that is not yet available on a replica
+            accuRev.syncReplica();            
         }
 
         boolean removedWorkspace = false;

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommandTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommandTest.java?rev=1075582&r1=1075581&r2=1075582&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/export/AccuRevExportCommandTest.java
Mon Feb 28 23:16:57 2011
@@ -81,6 +81,37 @@ public class AccuRevExportCommandTest
         assertHasScmFile( result.getExportedFiles(), "exported/file", ScmFileStatus.CHECKED_OUT
);
 
     }
+    
+    @Test
+    public void testExportToVersion490()
+        throws Exception
+    {
+     // info defaults to no workspace...
+        info.setWorkSpace( null );
+
+        when( accurev.info( basedir ) ).thenReturn( info );
+        
+        // A version that does not support pop -t
+        when( accurev.getClientVersion()).thenReturn( "4.9.0" );
+
+        List<File> poppedFiles = Collections.singletonList( new File( "exported/file"
) );
+        when(
+              accurev.popExternal( eq( basedir ), eq( "mySnapShot" ), eq( "676" ),
+                                   (Collection<File>) argThat( hasItem( new File( "/./project/dir"
) ) ) ) ).thenReturn(
+                                                                                        
                                poppedFiles );
+
+        AccuRevExportCommand command = new AccuRevExportCommand( getLogger() );
+
+        CommandParameters params = new CommandParameters();
+        params.setScmVersion( CommandParameter.SCM_VERSION, new ScmTag( "mySnapShot/676"
) );
+
+        ExportScmResult result = command.export( repo, new ScmFileSet( basedir ), params
);
+
+        assertTrue( result.isSuccess() );
+        assertHasScmFile( result.getExportedFiles(), "exported/file", ScmFileStatus.CHECKED_OUT
);
+        verify( accurev).syncReplica();
+
+    }
     @Test
     public void testExportVersionOutSideWorkspace()
         throws Exception



Mime
View raw message