~jan0sch/smederee

Showing details for patch 3903a0bbadc4050b2bc938ba69ac32ad71f423e1.
2024-06-10 (Mon), 11:12 AM - Jens Grassel - 3903a0bbadc4050b2bc938ba69ac32ad71f423e1

VCS: Code cleanup in overview section

Summary of changes
1 files modified with 12 lines added and 11 lines removed
  • modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala with 12 added and 11 removed lines
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))