Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmRevision


        }
        if ( scmVersion.length() > 0 )
        {
            if ( "revision".equals( scmVersionType ) )
            {
                return new ScmRevision( scmVersion );
            }
            else if ( "tag".equals( scmVersionType ) )
            {
                return new ScmTag( scmVersion );
            }
View Full Code Here


        ScmVersion startRevision = null;
        ScmVersion endRevision = null;

        if ( StringUtils.isNotEmpty( startTag ) )
        {
            startRevision = new ScmRevision( startTag );
        }

        if ( StringUtils.isNotEmpty( endTag ) )
        {
            endRevision = new ScmRevision( endTag );
        }

        return changeLog( repository, fileSet, startRevision, endRevision, null );
    }
View Full Code Here

        ScmVersion startVersion = null;
        ScmVersion endVersion = null;

        if ( StringUtils.isNotEmpty( startRevision ) )
        {
            startVersion = new ScmRevision( startRevision );
        }

        if ( StringUtils.isNotEmpty( endRevision ) )
        {
            endVersion = new ScmRevision( endRevision );
        }

        return diff( repository, fileSet, startVersion, endVersion );
    }
View Full Code Here

    {
        ScmVersion scmVersion = null;

        if ( StringUtils.isNotEmpty( tag ) )
        {
            scmVersion = new ScmRevision( tag );
        }

        return export( repository, fileSet, scmVersion, outputDirectory );
    }
View Full Code Here

    {
        ScmVersion scmVersion = null;

        if ( StringUtils.isNotEmpty( tag ) )
        {
            scmVersion = new ScmRevision( tag );
        }

        return list( repository, fileSet, recursive, scmVersion );
    }
View Full Code Here

      final ScmProvider provider) throws ScmException
  {
    try
    {
        ChangeLogScmResult result = null;
        ScmRevision endRev = null;
        ScmRevision startRev = null;
        ScmFileSet fileSet = createFileSet();

        InfoScmResult isr = provider.info(repository.getProviderRepository(), fileSet, null);
        if (isr != null)
        {
            for (InfoItem ii : isr.getInfoItems())
            {
                if (StringUtils.isNotEmpty(ii.getRevision()))
                {
                    // HG places a trailing + which confuses the scm provider.
                    endRev = new ScmRevision (ii.getRevision().replaceAll("\\+$", ""));
                }
            }
        }

        int currentRange = queryRangeInDays;
        if (repository.getProvider().equals("git"))
        {
            // Git can't handle x->x so use an inbuilt shortcut.
            startRev = new ScmRevision ("HEAD^");
        }
        else if (repository.getProvider().equals("svn"))
        {
            // Annoyingly the SCM provider almost always adds the URL which prevents the use of BASE.
            // Hence the hacky shortcut.
            startRev = endRev;
            endRev = new ScmRevision ("1");
        }
        else if (repository.getProvider().equals("hg") &&
                endRev.getName().contains("abort: there is no Mercurial repository here"))
        {
            // Unable to locate a HG repository.
View Full Code Here

    }

    public void testCommandLineWithStartVersion()
        throws Exception
    {
        testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision( "1" ), null,
                         "svn --non-interactive log -v -r 1:HEAD http://foo.com/svn/trunk" );
    }
View Full Code Here

    }

    public void testCommandLineWithStartVersionAndEndVersion()
        throws Exception
    {
        testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision( "1" ), new ScmRevision( "10" ),
                         "svn --non-interactive log -v -r 1:10 http://foo.com/svn/trunk" );
    }
View Full Code Here

    }

    public void testCommandLineWithStartVersionAndEndVersionEquals()
        throws Exception
    {
        testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision( "1" ), new ScmRevision( "1" ),
                         "svn --non-interactive log -v -r 1 http://foo.com/svn/trunk" );
    }
View Full Code Here

    }

    public void testCommandLineWithBaseVersion()
        throws Exception
    {
        testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision( "1" ), new ScmRevision( "BASE" ),
                         "svn --non-interactive log -v -r 1:BASE" );
    }
View Full Code Here

TOP

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

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.