Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmFile


            List<String> files = new ArrayList<String>();

            for ( Iterator<ScmFile> it = result.getFiles().iterator(); it.hasNext(); )
            {
                ScmFile f = it.next();
                files.add( f.getPath() );
            }

            return files;
        }
        catch ( ScmException e )
View Full Code Here


        StatusScmResult statusCmdResult = statusCmd.executeStatusCommand( repo, fileSet );
        List<ScmFile> statusScmFiles = statusCmdResult.getChangedFiles();

        for ( Iterator<ScmFile> it = statusScmFiles.iterator(); it.hasNext(); )
        {
            ScmFile file = (ScmFile) it.next();
            getLogger().debug( "Iterating over statusScmFiles: " + file );
            if ( file.getStatus() == ScmFileStatus.ADDED ||
                file.getStatus() == ScmFileStatus.DELETED ||
                file.getStatus() == ScmFileStatus.MODIFIED )
            {
                changedScmFiles.add( new ScmFile( file.getPath(), ScmFileStatus.CHECKED_IN ) );
                changedFiles.add( new File( parentFolder, file.getPath() ) );
            }
        }

        List<File> files = fileSet.getFileList();
        if ( files.size() == 0 )
        {
            // Either commit all local changes
            commitedFiles = changedScmFiles;
        }
        else
        {
            // Or commit specific files
            for ( int i = 0; i < files.size(); i++ )
            {
                if ( fileExistsInFileList( (File) ( files.get( i ) ), changedFiles ) )
                {
                    commitedFiles.add( new ScmFile( ( (File) files.get( i ) ).getPath(), ScmFileStatus.CHECKED_IN ) );
                }
            }
        }

        // Now that we have a list of files to process, we can "add" (scm checkin) them.
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

            if ( iter.hasNext() )
            {
                getLogger().debug( "Iterating over \"Update\" results" );
                while ( iter.hasNext() )
                {
                    ScmFile file = (ScmFile) iter.next();
                    getLogger().debug( file.getPath() + " : " + file.getStatus() );
                }
            }
            else
            {
                getLogger().debug( "There are no updated files" );
View Full Code Here

            if ( iter.hasNext() )
            {
                getLogger().debug( "Iterating over \"Status\" results" );
                while ( iter.hasNext() )
                {
                    ScmFile file = (ScmFile) iter.next();
                    getLogger().debug( file.getPath() + " : " + file.getStatus() );
                }
            }
            else
            {
                getLogger().debug( "There are no differences" );
View Full Code Here

        Map<String, CharSequence> differences = new HashMap<String, CharSequence>();

        // Now lets iterate through them
        for ( Iterator<ScmFile> it = statusScmFiles.iterator(); it.hasNext(); )
        {
            ScmFile file = (ScmFile) it.next();
            if ( file.getStatus() == ScmFileStatus.MODIFIED )
            {
                // The "scm status" command returns files relative to the sandbox root.
                // Whereas the "scm diff" command needs them relative to the working directory.
                File fullPath = new File( parentFolder, file.getPath() );
                String relativePath = fullPath.toString().substring( baseDir.toString().length() );
                getLogger().debug( "Full Path     : '" + fullPath + "'" );
                getLogger().debug( "Relative Path : '" + relativePath + "'" );

                // Now call "scm diff on it"
View Full Code Here

  private void filterDotFiles(final List<ScmFile> files)
  {
    for (final Iterator<ScmFile> i = files.iterator(); i.hasNext();)
    {
      final ScmFile file = i.next();
      final String path = file.getPath();
      if (path.length() > 0 && path.charAt(0) == '.')
      {
        i.remove();
      }
    }
View Full Code Here

            //Do nothing

            return;
        }

        addFile( new ScmFile( file, status ) );
       
        List<ChangeFile>
        changeFiles =
            Arrays.asList( new ChangeFile[] { new ChangeFile( line, Integer.valueOf( revision ).toString() ) } );
View Full Code Here

            assertNotNull( result.getUpdatedFiles() );

            assertEquals( 2, result.getUpdatedFiles().size() );

            ScmFile file1 = result.getUpdatedFiles().get( 0 );

            assertPath( "Foo.java", file1.getPath() );

            assertEquals( ScmFileStatus.UPDATED, file1.getStatus() );

            ScmFile file2 = result.getUpdatedFiles().get( 1 );

            assertPath( "New.txt", file2.getPath() );

            assertEquals( ScmFileStatus.UPDATED, file2.getStatus() );
        }
        finally
        {
            IOUtil.close( writer );
        }
View Full Code Here

            SynergyUtil.stop( getLogger(), ccmAddr );
        }
        List<ScmFile> files = new ArrayList<ScmFile>();
        for ( File f : fileSet.getFileList() )
        {
            files.add( new ScmFile( f.getPath(), ScmFileStatus.UNKNOWN ) );
        }
        return new UnEditScmResult( "", files );
    }
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.