···1414;;
15151616let check_startup () =
1717- match jj_no_log_errorable ~color:false [ "log"; "''" ] with
1717+ match jj_no_log_errorable ~color:false ~snapshot:false [ "op";"log"; "-l";"0" ] with
1818 | Ok _ ->
1919 `Good
2020 | Error (`BadExit (i, str)) ->
+8
jj_tui/bin/jj_process.ml
···143143144144 (* Ui_loop.run (Lwd.pure (W.printf "Hello world"));; *)
145145 let cmdArgs cmd args =
146146+ let start_time = Unix.gettimeofday () in
146147 let code, status, out_content, err_content = picos_process cmd args in
148148+ let end_time = Unix.gettimeofday () in
149149+ [%log
150150+ debug
151151+ "Executing '%s %s' took: %fms "
152152+ cmd
153153+ (args |> String.concat " ")
154154+ ((end_time -. start_time) *. 1000.)];
147155 let exit_code =
148156 match status with
149157 | Unix.WEXITED code ->
+1-1
jj_tui/bin/jj_ui.ml
···171171 (*we want to initialize our states and keep them up to date*)
172172 match check_startup () with
173173 | `Good ->
174174- update_status ~cause_snapshot:true ();
174174+ (* update_status ~cause_snapshot:true (); *)
175175 Flock.fork (fun () ->
176176 while true do
177177 Picos.Fiber.sleep ~seconds:5.0;
+2-2
jj_tui/bin/main.ml
···3030 let rec loop () =
3131 if not (Lwd.peek quit)
3232 then (
3333- let start_time = Sys.time () in
3333+ let start_time = Unix.gettimeofday() in
3434 let term_width, term_height = Notty_unix.Term.size (Vars.get_term ()) in
3535 let prev_term_width, prev_term_height = Lwd.peek Vars.term_width_height in
3636 if term_width <> prev_term_width || term_height <> prev_term_height
···4444 (*Sleep for a bit to stop spinning the cpu
4545 TODO: May not be needed, nottui may sleep for a bit anyway
4646 *)
4747- let end_time = Sys.time () in
4747+ let end_time = Unix.gettimeofday () in
4848 let elapsed = end_time -. start_time in
4949 let sleep_time = max 0.01 (0.01 -. elapsed) in
5050 Picos_io.Unix.sleepf sleep_time;
+6-3
jj_tui/lib/process_wrappers.ml
···66open! Util
77open Process
88open Logging
99+open Picos_std_structured
9101011exception FoundStart
1112exception FoundFiller
···211212212213 (** returns the graph and a list of revs within that graph*)
213214 let graph_and_revs ?revset () =
214214- let selectable_count, graph =
215215+ let graph =
216216+ Flock.fork_as_promise @@ fun () ->
215217 let revset_arg = match revset with Some revset -> [ "-r"; revset ] | None -> [] in
216218 let output = jj_no_log ([ "log" ] @ revset_arg) in
217219 output |> find_selectable_from_graph
218218- in
219219- let revs = get_revs ?revset () in
220220+ and revs = Flock.fork_as_promise @@ fun () -> get_revs ?revset () in
221221+ let selectable_count, graph = Promise.await graph
222222+ and revs = Promise.await revs in
220223 (*The graph should never have selectable items that don't also have a rev*)
221224222225 (* TODO: remove this becasue it's just for debugging*)