private Map < String , Collection < String > > buildCommitGraph ( List < Commit > commits ) { // multimap api doesn't quite fit what we want to do here Map < String , Collection < String > > rt = new HashMap <> ( ) ; // TODO build graph for svn for ( Commit commit : commits ) { String revisionNumber = commit . getScmRevisionNumber ( ) ; boolean alreadyExists = false ; List < String > parentRevisionNumbers = commit . getScmParentRevisionNumbers ( ) ; if ( parentRevisionNumbers == null ) { alreadyExists = rt . put ( revisionNumber , new ArrayList <> ( ) ) != null ; } else { alreadyExists = rt . put ( revisionNumber , parentRevisionNumbers ) != null ; } if ( alreadyExists ) { logger . warn ( "Error encountered building pipeline: multiple commits exist for revision number " + revisionNumber ) ; } } return rt ; }
We assume each commit belongs to the same repo + branch