Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCM-948 - Make limit parameter work for svnexe and gitexe changelog goal #119

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import org.apache.maven.scm.CommandParameter;
import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmResult;

/**
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
Expand All @@ -51,7 +54,24 @@ public class GitChangeLogCommand
{
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss Z";

@Override
public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
throws ScmException
{
return executeChangeLogCommand( repository, fileSet,
parameters.getDate( CommandParameter.START_DATE, null ),
parameters.getDate( CommandParameter.END_DATE, null ),
(ScmBranch) parameters.getScmVersion( CommandParameter.BRANCH, null ),
parameters.getString( CommandParameter.CHANGELOG_DATE_PATTERN, null ),
parameters.getScmVersion( CommandParameter.START_SCM_VERSION, null ),
parameters.getScmVersion( CommandParameter.END_SCM_VERSION, null ),
parameters.getInt( CommandParameter.LIMIT, -1 ),
parameters.getScmVersion( CommandParameter.SCM_VERSION, null ) );
}

/** {@inheritDoc} */
@Override
protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet,
ScmVersion startVersion, ScmVersion endVersion,
String datePattern )
Expand All @@ -61,6 +81,7 @@ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo
}

/** {@inheritDoc} */
@Override
protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet,
Date startDate, Date endDate, ScmBranch branch,
String datePattern )
Expand Down Expand Up @@ -148,9 +169,21 @@ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo
// ----------------------------------------------------------------------

/**
* this constructs creates the commandline for the git-whatchanged command.
* <p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This <p> isn't necessary.

* This method creates the commandline for the git-whatchanged command.
* </p>
* <p>
* Since it uses --since and --until for the start and end date, the branch
* and version parameters can be used simultanously.
* </p>
* @param repository Provider repositry to use.
* @param workingDirectory Working copy directory.
* @param branch Branch to run command on.
* @param startDate Start date of log entries.
* @param endDate End date of log entries.
* @param startVersion Start version of log entries.
* @param endVersion End version of log entries.
* @return Command line.
*/
public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory,
ScmBranch branch, Date startDate, Date endDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
import java.util.Date;
import java.util.Objects;
import java.util.TimeZone;
import org.apache.maven.scm.CommandParameter;
import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmResult;

/**
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
Expand All @@ -56,8 +59,24 @@ public class SvnChangeLogCommand
{
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss Z";

@Override
public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
throws ScmException
{
return executeChangeLogCommand( repository, fileSet,
parameters.getDate( CommandParameter.START_DATE, null ),
parameters.getDate( CommandParameter.END_DATE, null ),
(ScmBranch) parameters.getScmVersion( CommandParameter.BRANCH, null ),
parameters.getString( CommandParameter.CHANGELOG_DATE_PATTERN, null ),
parameters.getScmVersion( CommandParameter.START_SCM_VERSION, null ),
parameters.getScmVersion( CommandParameter.END_SCM_VERSION, null ),
parameters.getInt( CommandParameter.LIMIT, -1 ) );
}

/** {@inheritDoc} */
@Deprecated
@Override
protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet,
ScmVersion startVersion, ScmVersion endVersion,
String datePattern )
Expand All @@ -68,6 +87,7 @@ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo

/** {@inheritDoc} */
@Deprecated
@Override
protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet,
Date startDate, Date endDate, ScmBranch branch,
String datePattern )
Expand Down