Package org.apache.maven.scm.command.changelog

Examples of org.apache.maven.scm.command.changelog.ChangeLogScmResult


        HgChangeLogConsumer consumer = new HgChangeLogConsumer( getLogger(), datePattern );
        ScmResult result = HgUtils.execute( consumer, getLogger(), fileSet.getBasedir(), cmd );

        List<ChangeSet> logEntries = consumer.getModifications();
        ChangeLogSet changeLogSet = new ChangeLogSet( logEntries, startDate, endDate );
        return new ChangeLogScmResult( changeLogSet, result );
    }
View Full Code Here


            endDate = logEntries.get( logEntries.size() - 1 ).getDate();
        }
        ChangeLogSet changeLogSet = new ChangeLogSet( logEntries, startDate, endDate );
        changeLogSet.setStartVersion( startVersion );
        changeLogSet.setEndVersion( endVersion );
        return new ChangeLogScmResult( changeLogSet, result );
    }
View Full Code Here

    public ScmProviderStub()
    {
        setScmSpecificFilename( "" );
        setAddScmResult( new AddScmResult( "", Collections.<ScmFile>emptyList() ) );
        setBranchScmResult( new BranchScmResult( "", Collections.<ScmFile>emptyList() ) );
        setChangeLogScmResult( new ChangeLogScmResult( "", "", "", true ) );
        setCheckInScmResult( new CheckInScmResult( "", "", "", true ) );
        setCheckOutScmResult( new CheckOutScmResult( "", "", "", true ) );
        setDiffScmResult( new DiffScmResult( "", "", "", true ) );
        setEditScmResult( new EditScmResult( "", "", "", true ) );
        setExportScmResult( new ExportScmResult( "", "", "", true ) );
View Full Code Here

        int exitCode;

        exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new ChangeLogScmResult( cl.toString(), "The git-log command failed.", stderr.getOutput(), false );
        }
        ChangeLogSet changeLogSet = new ChangeLogSet( consumer.getModifications(), startDate, endDate );
        changeLogSet.setStartVersion( startVersion );
        changeLogSet.setEndVersion( endVersion );

        return new ChangeLogScmResult( cl.toString(), changeLogSet );
    }
View Full Code Here

        Thread.sleep( 1000 );
        ScmProvider provider = getScmManager().getProviderByRepository( getScmRepository() );
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );

        //We should have one log entry for the initial repository
        ChangeLogScmResult result =
            provider.changeLog( getScmRepository(), fileSet, null, null, 0, (ScmBranch) null, null );
        assertTrue( result.getProviderMessage(), result.isSuccess() );
        assertEquals( 1, result.getChangeLog().getChangeSets().size() );

        //Make a timestamp that we know are after initial revision but before the second
        Date timeBeforeSecond = new Date(); //Current time

        // pause a couple seconds... [SCM-244]
        Thread.sleep( 2000 );

        //Make a change to the readme.txt and commit the change
        ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" );
        CheckInScmResult checkInResult = provider.checkIn( getScmRepository(), fileSet, COMMIT_MSG );
        assertTrue( "Unable to checkin changes to the repository", checkInResult.isSuccess() );

        result = provider.changeLog( getScmRepository(), fileSet, (ScmVersion) null, null );
        assertTrue( result.getProviderMessage(), result.isSuccess() );
        assertEquals( 2, result.getChangeLog().getChangeSets().size() );

        //Now only retrieve the changelog after timeBeforeSecondChangeLog
        Date currentTime = new Date();
        result = provider
            .changeLog( getScmRepository(), fileSet, timeBeforeSecond, currentTime, 0, new ScmBranch( "" ) );

        //Thorough assert of the last result
        assertTrue( result.getProviderMessage(), result.isSuccess() );
        assertEquals( 1, result.getChangeLog().getChangeSets().size() );
        ChangeSet changeset = result.getChangeLog().getChangeSets().get( 0 );
        assertTrue( changeset.getDate().after( timeBeforeSecond ) );
        assertEquals( COMMIT_MSG, changeset.getComment() );
    }
View Full Code Here

      }

      final ScmRepository repository =
              scmConnectionInfo.createRepository(scmManager);
      final ScmProvider provider = createScmProvider(repository);
      final ChangeLogScmResult result =
              scmAccessInfo.fetchChangeLog(repository, provider);

      Revision revision = null;

      if (result != null && result.isSuccess())
      {
          final List<ChangeSet> changeLogSets = result.getChangeLog().getChangeSets();

          if (changeLogSets.size() > 0)
          {
              revision = new StringRevision (changeLogSets.get(0).getRevision(),
                      changeLogSets.get(0).getDate());
View Full Code Here

  public ChangeLogScmResult fetchChangeLog(final ScmRepository repository,
      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);
View Full Code Here

        // TODO: probably need to base this from a working directory in the main configuration
        File workingDirectory = configuration.getWorkingDirectory();

        ScmRepository repository = getScmRepository( configuration );

        ChangeLogScmResult result;

        ScmFileSet fileSet = new ScmFileSet( workingDirectory );

        result = scmManager.changeLog( repository, fileSet, scmVersion, scmVersion );
View Full Code Here

        }

        ChangeLogSet cls = new ChangeLogSet( describeConsumer.getModifications(), null, null );
        cls.setStartVersion(startVersion);
        cls.setEndVersion(endVersion);
        return new ChangeLogScmResult( cl.toString(), cls );
    }
View Full Code Here

                }
            }
        }

        ChangeLogSet changeLogSet = new ChangeLogSet( inRangeAndValid, startDate, endDate );
        return new ChangeLogScmResult( changeLogSet, result );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.command.changelog.ChangeLogScmResult

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.