@@ -458,17 +458,18 @@ public int compare(SVNDirEntry o1, SVNDirEntry o2) {
458458 }
459459 }
460460 }
461-
461+
462462 @ Override
463- public List <String > getCommitMessages (String branchName , Integer limit ) {
464- final List <String > res = new ArrayList <>();
463+ public List <VCSCommit > log (String branchName , int limit ) {
464+ final List <VCSCommit > res = new ArrayList <>();
465465 try {
466+ getBranchUrl (branchName ); // for exception test only
466467 repository .log (new String [] { getBranchName (branchName ) },
467468 -1L /* start from head descending */ ,
468469 0L , true , true , limit , new ISVNLogEntryHandler () {
469470 @ Override
470471 public void handleLogEntry (SVNLogEntry logEntry ) throws SVNException {
471- res .add (logEntry . getMessage ( ));
472+ res .add (svnLogEntryToVCSCommit ( logEntry ));
472473 }
473474 });
474475 return res ;
@@ -518,8 +519,7 @@ public List<VCSCommit> getCommitsRange(String branchName, String firstCommitId,
518519 new ISVNLogEntryHandler () {
519520 @ Override
520521 public void handleLogEntry (SVNLogEntry logEntry ) throws SVNException {
521- VCSCommit commit = new VCSCommit (Long .toString (logEntry .getRevision ()), logEntry .getMessage (),
522- logEntry .getAuthor ());
522+ VCSCommit commit = svnLogEntryToVCSCommit (logEntry );
523523 res .add (commit );
524524 }
525525 });
@@ -530,6 +530,11 @@ public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
530530 throw new RuntimeException (e );
531531 }
532532 }
533+
534+ private VCSCommit svnLogEntryToVCSCommit (SVNLogEntry logEntry ) {
535+ return new VCSCommit (Long .toString (logEntry .getRevision ()), logEntry .getMessage (),
536+ logEntry .getAuthor ());
537+ }
533538
534539 @ Override
535540 public List <VCSCommit > getCommitsRange (String branchName , String firstCommitId , String untilCommitId ) {
@@ -543,9 +548,7 @@ public List<VCSCommit> getCommitsRange(String branchName, String firstCommitId,
543548 new ISVNLogEntryHandler () {
544549 @ Override
545550 public void handleLogEntry (SVNLogEntry logEntry ) throws SVNException {
546- VCSCommit commit = new VCSCommit (Long .toString (logEntry .getRevision ()), logEntry .getMessage (),
547- logEntry .getAuthor ());
548- res .add (commit );
551+ res .add (svnLogEntryToVCSCommit (logEntry ));
549552 }
550553 });
551554 return res ;
@@ -566,8 +569,7 @@ public VCSCommit getHeadCommit(String branchName) {
566569 try {
567570 SVNLogEntry entry = revToSVNEntry (getBranchName (branchName ), -1L );
568571 if (entry != null ) {
569- return new VCSCommit (Long .toString (entry .getRevision ()), entry .getMessage (),
570- entry .getAuthor ());
572+ return svnLogEntryToVCSCommit (entry );
571573 }
572574 return null ;
573575 } catch (SVNException e ) {
@@ -688,8 +690,7 @@ public VCSTag getLastTag() {
688690 tagName = name .replace ("/" + TAGS_PATH , "" ) ;
689691 }
690692
691- return new VCSTag (tagName , entry .getMessage (), entry .getAuthor (), new VCSCommit (Long .toString (copyFromEntry .getRevision ()),
692- copyFromEntry .getMessage (), copyFromEntry .getAuthor ()));
693+ return new VCSTag (tagName , entry .getMessage (), entry .getAuthor (), svnLogEntryToVCSCommit (copyFromEntry ));
693694 } catch (SVNException e ) {
694695 throw new EVCSException (e );
695696 } catch (Exception e ) {
0 commit comments