~jan0sch/smederee
Showing details for patch 3903a0bbadc4050b2bc938ba69ac32ad71f423e1.
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala --- old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala 2025-01-11 17:59:21.037530933 +0000 +++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala 2025-01-11 17:59:21.037530933 +0000 @@ -458,17 +458,18 @@ case Some(repoId) => vcsMetadataRepo.findVcsRepositoryBranches(repoId).compile.toList case _ => Sync[F].delay(List.empty) } - vcsLog <- darcs.log(directory.toNIO)(repositoryName.toString)(Chain(s"--max-count=2", "--xml-output")) - xmlLog <- Sync[F].delay(scala.xml.XML.loadString(vcsLog.stdout.toList.mkString)) - patches <- Sync[F].delay( - (xmlLog \ "patch").flatMap(VcsRepositoryPatchMetadata.fromDarcsXmlLog).toList.map { patch => - // TODO: Move the hard coded number into a configuration value. - if (patch.comment.exists(_.length > 320)) - patch.copy(comment = patch.comment.map(c => VcsPatchComment(c.toString.take(320) + "..."))) - else - patch - } - ) + patches <- darcs + .log(directory.toNIO)(repositoryName.toString)(Chain(s"--max-count=2", "--xml-output")) + .map(log => scala.xml.XML.loadString(log.stdout.toList.mkString)) + .map(xmlLog => + (xmlLog \ "patch").flatMap(VcsRepositoryPatchMetadata.fromDarcsXmlLog).toList.map { patch => + // TODO: Move the hard coded number into a configuration value. + if (patch.comment.exists(_.length > 320)) + patch.copy(comment = patch.comment.map(c => VcsPatchComment(c.toString.take(320) + "..."))) + else + patch + } + ) lastTag <- darcs .log(directory.toNIO)(repositoryName.toString)(Chain(s"--from-tag=.", "--to-tag=.", "--xml-output")) .map(log => scala.xml.XML.loadString(log.stdout.toList.mkString))