-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SCM-948] Make limit parameter work for svnexe and gitexe changelog goal
This closes #119
- Loading branch information
Showing
2 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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 ) | ||
|
@@ -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 ) | ||
|
@@ -148,9 +169,19 @@ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo | |
// ---------------------------------------------------------------------- | ||
|
||
/** | ||
* this constructs creates the commandline for the git-whatchanged command. | ||
* This method creates the commandline for the git-whatchanged command. | ||
* <p> | ||
* Since it uses --since and --until for the start and end date, the branch | ||
* and version parameters can be used simultanously. | ||
* | ||
* @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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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 ) | ||
|
@@ -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 ) | ||
|