# # # patch "monotone.ml" # from [e96a644b538acbca1d01fb33357b1c3198c71d12] # to [18d1d921e87aa7748b5e3d99a30230d4074bfe86] # ============================================================ --- monotone.ml e96a644b538acbca1d01fb33357b1c3198c71d12 +++ monotone.ml 18d1d921e87aa7748b5e3d99a30230d4074bfe86 @@ -188,9 +188,29 @@ let get_ids mtn query = NodeMap.empty (selectors_of_query query) + +(* for some reason `automate stdio graph' is much slower then `automate graph'. + So use the non-stdio version for now. *) +(* let graph mtn = *) +(* Automate.submit_sync *) +(* mtn [ "graph" ] *) + +let fake_status = object method push s = () method pop () = () end + let graph mtn = - Automate.submit_sync - mtn [ "graph" ] + let do_pump = ref true in + let output = ref None in + ignore (spawn_monotone mtn [ "automate" ; "graph" ] None fake_status + (fun arg -> + do_pump := false ; + output := Some arg)) ; + while !do_pump do + ignore (Glib.Main.iteration true) + done ; + match Viz_misc.some !output with + | `OUTPUT data -> data + | `SUB_PROC_ERROR msg -> + Viz_types.errorf "mtn automate error: %s" msg let children mtn id f init = Automate.submit_sync mtn [ "children" ; id ]