Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmFile


        siViewNonMem.addOption( new Option( "cwd", sandboxDir ) );
        Response response = api.runCommand( siViewNonMem );
        for ( WorkItemIterator wit = response.getWorkItems(); wit.hasNext(); )
        {
            filesAdded.add(
                new ScmFile( wit.next().getField( "absolutepath" ).getValueAsString(), ScmFileStatus.ADDED ) );
        }
        return filesAdded;

    }
View Full Code Here


            List<ScmFile> newFileList = getNewMembers( exclude, include );
            for ( Iterator<ScmFile> sit = newFileList.iterator(); sit.hasNext(); )
            {
                try
                {
                    ScmFile localFile = sit.next();
                    // Attempt to add the file to the Integrity repository
                    add( new File( localFile.getPath() ), message );
                    // If it was a success, then add it to the list of files that were actually added
                    filesAdded.add( localFile );
                }
                catch ( APIException aex )
                {
View Full Code Here

                        // Lock each member as you go...
                        lock( memberFile, wi.getId() );
                        // Commit the changes...
                        checkin( memberFile, wi.getId(), message );
                        // Update the changed file list
                        changedFiles.add( new ScmFile( memberFile.getAbsolutePath(), ScmFileStatus.CHECKED_IN ) );
                    }
                    else
                    {
                        // Drop the member if there is no working file
                        dropMember( memberFile, wi.getId() );
                        // Update the changed file list
                        changedFiles.add( new ScmFile( memberFile.getAbsolutePath(), ScmFileStatus.DELETED ) );
                    }
                }
                catch ( APIException aex )
                {
                    // Set the ciSuccess to false, since we ran into a problem
View Full Code Here

        for ( ScmFile file : diffFiles )
        {
            changes.add( diffChanges.get( file.getPath() ) );
            if ( file.getStatus() == ScmFileStatus.MODIFIED )
            {
                updatedFiles.add( new ScmFile( file.getPath(), ScmFileStatus.PATCHED ) );
            }
            else
            {
                updatedFiles.add( file );
            }
View Full Code Here

                }
            }

            for ( String file : files )
            {
                changedFiles.add( new ScmFile( file, status ) );
            }
        }
    }
View Full Code Here

        if ( !revisionRegexp.match( line ) )
        {
            error( line );
        }

        edits.add( new ScmFile( revisionRegexp.getParen( 1 ), ScmFileStatus.EDITED ) );
    }
View Full Code Here

        if ( line.startsWith( INDEX_TOKEN ) )
        {
            // start a new file
            currentFile = line.substring( INDEX_TOKEN.length() );

            changedFiles.add( new ScmFile( currentFile, ScmFileStatus.MODIFIED ) );

            currentDifference = new StringBuilder();

            differences.put( currentFile, currentDifference );
View Full Code Here

        // Assert the files in the updated files list
        // ----------------------------------------------------------------------

        Iterator<ScmFile> files = new TreeSet<ScmFile>( changedFiles ).iterator();

        ScmFile file = files.next();
        assertPath( "/src/main/java/org/Foo.java", file.getPath() );
        assertEquals( ScmFileStatus.ADDED, file.getStatus() );

        file = files.next();
        assertPath( "/pom.xml", file.getPath() );
        assertEquals( ScmFileStatus.MODIFIED, file.getStatus() );

        assertFile( getUpdatingCopy(), "/readme.txt" );

        assertFalse( "project.xml created incorrectly", new File( getUpdatingCopy(), "/project.xml" ).exists() );
    }
View Full Code Here

        assertNotNull( files );

        assertEquals( 2, files.size() );

        Map<String, ScmFile> fileMap = mapFilesByPath( files );
        ScmFile file1 = fileMap.get( "src/main/java/Foo.java" );
        assertNotNull( file1 );
        assertEquals( ScmFileStatus.CHECKED_IN, file1.getStatus() );

        ScmFile file2 = fileMap.get( "readme.txt" );
        assertNotNull( file2 );
        assertEquals( ScmFileStatus.CHECKED_IN, file2.getStatus() );

        CheckOutScmResult checkoutResult =
            getScmManager().checkOut( getScmRepository(), new ScmFileSet( getAssertionCopy() ) );

        assertResultIsSuccess( checkoutResult );
View Full Code Here

        // ----------------------------------------------------------------------

        Iterator<ScmFile> files = new TreeSet<ScmFile>( changedFiles ).iterator();

        //Check Foo.java
        ScmFile file = files.next();

        assertPath( "/src/main/java/org/Foo.java", file.getPath() );

        assertTrue( file.getStatus().isDiff() );

        String postRangeStr = "+/src/main/java/org/Foo.java\n\\ No newline at end of file\n";
        String actualStr = differences.get( file.getPath() ).toString();
        assertTrue( actualStr.endsWith( postRangeStr ) );

        //Check readme.txt
        file = files.next();

        assertPath( "/readme.txt", file.getPath() );

        assertTrue( file.getStatus().isDiff() );

        postRangeStr =
            "-/readme.txt\n\\ No newline at end of file\n+changed readme.txt\n\\ No newline at end of file\n";
        actualStr = differences.get( file.getPath() ).toString();
        assertTrue( actualStr.endsWith( postRangeStr ) );

        //Check project.xml
        file = files.next();

        assertPath( "/project.xml", file.getPath() );

        postRangeStr = "+changed project.xml\n\\ No newline at end of file\n";
        actualStr = differences.get( file.getPath() ).toString();
        assertTrue( actualStr.endsWith( postRangeStr ) );

        assertTrue( file.getStatus().isDiff() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.ScmFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.