Examples of GitScmProviderRepository


Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

    /** {@inheritDoc} */
    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
                                                      ScmVersion version )
        throws ScmException
    {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();

        int exitCode;
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

        if ( !fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "This provider doesn't support tagging subsets of a directory" );
        }

        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null );

        try
        {
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

    /** {@inheritDoc} */
    protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet,
                                                    ScmVersion scmVersion )
        throws ScmException
    {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() )
            && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 )
        {
            throw new ScmException( "remote repository must not be the working directory" );
        }

        int exitCode;
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

     */
    protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
                                           boolean binary )
        throws ScmException
    {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if ( fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "You must provide at least one file/directory to add" );
        }
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

        if ( !fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "This provider doesn't support branching subsets of a directory" );
        }

        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), branch );

        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

    @Override
    protected ScmProviderRepository getScmProviderRepository()
        throws Exception
    {
        return new GitScmProviderRepository( getScmUrl().substring( "scm:git:".length() ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

     */
    protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
                                                        ScmVersion version, boolean recursive )
        throws ScmException
    {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() )
            && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 )
        {
            throw new ScmException( "remote repository must not be the working directory" );
        }

        Git git = null;
        try
        {

            ProgressMonitor monitor = JGitUtils.getMonitor( getLogger() );

            String branch = version != null ? version.getName() : null;

            if ( StringUtils.isBlank( branch ) )
            {
                branch = Constants.MASTER;
            }

            getLogger().debug( "try checkout of branch: " + branch );

            if ( !fileSet.getBasedir().exists() || !( new File( fileSet.getBasedir(), ".git" ).exists() ) )
            {
                if ( fileSet.getBasedir().exists() )
                {
                    // git refuses to clone otherwise
                    fileSet.getBasedir().delete();
                }

                // FIXME only if windauze
                WindowCacheConfig cfg = new WindowCacheConfig();
                cfg.setPackedGitMMAP( false );
                cfg.install();

                // no git repo seems to exist, let's clone the original repo
                CredentialsProvider credentials = JGitUtils.getCredentials( (GitScmProviderRepository) repo );
                getLogger().info( "cloning [" + branch + "] to " + fileSet.getBasedir() );
                CloneCommand command = Git.cloneRepository().setURI( repository.getFetchUrl() );
                command.setCredentialsProvider( credentials ).setBranch( branch ).setDirectory( fileSet.getBasedir() );
                command.setProgressMonitor( monitor );
                git = command.call();
            }

View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

    private ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter )
        throws ScmException
    {
        ScmUrlParserResult result = new ScmUrlParserResult();

        result.repository = new GitScmProviderRepository( scmSpecificUrl );

        return result;
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

        ScmLogger logger = new DefaultLog();

        GitCommand command = new GitExeScmProvider().getInfoCommand();
        command.setLogger(logger);
        try {
            ScmProviderRepository repository = new GitScmProviderRepository(basedir.getAbsolutePath());
            ScmFileSet fileSet = new ScmFileSet(basedir);
            CommandParameters parameters = new CommandParameters();
            result = (InfoScmResult) command.execute(repository, fileSet, parameters);
        } catch (ScmException e) {
            if (logger.isErrorEnabled()) {
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

                anonymousAccessCVS( cvsRepo );
            }
            else if ( anonymousRepository != null && isScmSystem( anonymousRepository, "git" ) )
            {
                GitScmProviderRepository gitRepo = (GitScmProviderRepository) anonymousRepository
                    .getProviderRepository();

                anonymousAccessGit( gitRepo );
            }
            else if ( anonymousRepository != null && isScmSystem( anonymousRepository, "hg" ) )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.