@@ -11,11 +11,13 @@ let files_to_promote ~common files : Dune_rpc.Files_to_promote.t =
1111 These files
1212;;
1313
14- let on_missing fn =
15- User_warning. emit
16- [ Pp. paragraphf " Nothing to promote for %s." (Path.Source. to_string_maybe_quoted fn)
17- |> Pp. tag User_message.Style. Warning
18- ]
14+ let on_missing missing =
15+ List. sort missing ~compare: Path.Source. compare
16+ |> List. iter ~f: (fun fn ->
17+ User_warning. emit
18+ [ Pp. paragraphf " Nothing to promote for %s." (Path.Source. to_string_maybe_quoted fn)
19+ |> Pp. tag User_message.Style. Warning
20+ ])
1921;;
2022
2123module Apply = struct
@@ -51,10 +53,7 @@ module Apply = struct
5153 Scheduler_setup. go_without_rpc_server ~common ~config (fun () ->
5254 let open Fiber.O in
5355 let + () = Fiber. return () in
54- let missing =
55- Diff_promotion. promote_files_registered_in_last_run files_to_promote
56- in
57- List. iter ~f: on_missing missing)
56+ Diff_promotion. promote_files_registered_in_last_run files_to_promote |> on_missing)
5857 | Error lock_held_by ->
5958 Scheduler_setup. no_build_no_rpc ~config (fun () ->
6059 let open Fiber.O in
@@ -84,11 +83,11 @@ module Diff = struct
8483 let files_to_promote = files_to_promote ~common files in
8584 (* CR-soon rgrinberg: remove pointless args *)
8685 Scheduler_setup. no_build_no_rpc ~config (fun () ->
87- let open Fiber.O in
8886 let db = Diff_promotion. load_db () in
89- let all = Diff_promotion. partition_db db files_to_promote in
90- let * missing = Diff_promotion. missing all in
91- List. iter ~f: on_missing missing;
87+ let ({ Diff_promotion. present = _; missing } as all) =
88+ Diff_promotion. partition_db db files_to_promote
89+ in
90+ on_missing missing;
9291 Diff_promotion. display_diffs all)
9392 ;;
9493
@@ -112,8 +111,7 @@ module Files = struct
112111 let { Diff_promotion. present; missing } =
113112 Diff_promotion. partition_db db files_to_promote
114113 in
115- let missing = List. sort missing ~compare: Path.Source. compare in
116- List. iter ~f: on_missing missing;
114+ on_missing missing;
117115 List. sort present ~compare: (fun x y ->
118116 Path.Source. compare (Diff_promotion.File. source x) (Diff_promotion.File. source y))
119117 |> List. iter ~f: (fun file ->
@@ -153,11 +151,13 @@ module Show = struct
153151 let files_to_promote = files_to_promote ~common files in
154152 (* CR-soon rgrinberg: remove pointless args *)
155153 Scheduler_setup. no_build_no_rpc ~config (fun () ->
156- let open Fiber.O in
157154 let db = Diff_promotion. load_db () in
158- let all = Diff_promotion. partition_db db files_to_promote in
159- let + () = Diff_promotion. missing all >> | List. iter ~f: on_missing in
160- display_corrected_contents db files_to_promote)
155+ let { Diff_promotion. present = _; missing } =
156+ Diff_promotion. partition_db db files_to_promote
157+ in
158+ on_missing missing;
159+ display_corrected_contents db files_to_promote;
160+ Fiber. return () )
161161 ;;
162162
163163 let command = Cmd. v info term
0 commit comments