cquoss commented on a change in pull request #109:
URL: https://github.com/apache/maven-scm/pull/109#discussion_r561290337



##########
File path: 
maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java
##########
@@ -125,24 +145,58 @@ public void execute()
 
             ScmProvider provider = getScmManager().getProviderByRepository( 
repository );
 
-            ScmVersion startRev =
-                getScmVersion( StringUtils.isEmpty( startScmVersionType ) ? 
VERSION_TYPE_REVISION
-                               : startScmVersionType, startScmVersion );
-            ScmVersion endRev =
-                getScmVersion( StringUtils.isEmpty( endScmVersionType ) ? 
VERSION_TYPE_REVISION
-                               : endScmVersionType, endScmVersion );
+            ChangeLogScmRequest request = new ChangeLogScmRequest( repository, 
getFileSet() );
+
+            request.setDatePattern( dateFormat );
+
+            if ( StringUtils.isNotEmpty( endDate ) )
+            {
+                request.setEndDate( parseDate( localFormat, endDate ) );
+            }
+            
+            if ( StringUtils.isNotEmpty( endScmVersion ) )
+            {
+                ScmVersion endRev =
+                    getScmVersion( StringUtils.isEmpty( endScmVersionType ) ? 
VERSION_TYPE_REVISION 
+                        : endScmVersionType, endScmVersion );
+                request.setEndRevision( endRev );
+            }
+
+            request.setLimit(limit);
+
+            if ( numDays != null )
+            {
+                request.setNumDays( numDays );
+            }
+
+            if ( StringUtils.isNotEmpty( scmVersion ) )
+            {
+                ScmVersion rev =
+                    getScmVersion( StringUtils.isEmpty( scmVersionType ) ? 
VERSION_TYPE_REVISION
+                        : scmVersionType, scmVersion );
+                request.setRevision( rev );
+            }
 
-            ChangeLogScmResult result;
-            if ( startRev != null || endRev != null )
+            if ( StringUtils.isNotEmpty( scmBranch ) )
             {
-                result = provider.changeLog( repository, getFileSet(), 
startRev, endRev, dateFormat );
+                request.setScmBranch( new ScmBranch( scmBranch ) );
             }
-            else
+            
+            if ( StringUtils.isNotEmpty( startDate ) )
             {
-                result = provider.changeLog( repository, getFileSet(), 
this.parseDate( localFormat, this.startDate ),
-                                             this.parseDate( localFormat, 
this.endDate ), 0,
-                                             (ScmBranch) getScmVersion( 
scmVersionType, scmVersion ), dateFormat );
+                request.setStartDate( parseDate( localFormat, startDate ) );
             }
+
+            if ( StringUtils.isNotEmpty( startScmVersion ) )

Review comment:
       Hmm. I believe i did some sort of alphabetical ordering. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to