You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/04/27 20:54:41 UTC

[GitHub] [maven-scm] cquoss commented on a change in pull request #109: [SCM-947]

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



##########
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:
       Should this be moved to somewhere else?




-- 
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:
users@infra.apache.org