[Unison-hackers] text ui: nothing is logged when there is nothing to propagate

Alan Schmitt alan.schmitt at polytechnique.org
Sat Mar 9 08:46:03 EST 2013


Benjamin C. Pierce writes:

>> I've noticed that, with the text ui, nothing is written to the log when
>> there is nothing to propagate, even if there were some problems or
>> conflicts.
>> 
>> Do you think it's reasonable to print something to the log if skipped >
>> 0 in this case?
>
> Yes, this seems good.

Here is a proposed patch for this. I duplicate the printing code, as I
did not find a clean way to factorize it.

Please let me know if I should commit this patch and the earlier ones as
well.

Alan

diff --git a/src/uitext.ml b/src/uitext.ml
index 5fca0d9..30a428b 100644
--- a/src/uitext.ml
+++ b/src/uitext.ml
@@ -604,6 +604,19 @@ let rec interactAndPropagateChanges reconItemList
     if !Update.foundArchives && Prefs.read Uicommon.repeat = "" then
       Update.commitUpdates ();
     display "No updates to propagate\n";
+    if skipped > 0 then
+      Safelist.iter
+        (fun ri ->
+         match ri.replicas with
+           Problem p ->
+           Trace.log (Printf.sprintf "[ERROR] Skipping %s\n  %s\n"
+                                     (Path.toString ri.path1) p)
+         | Different {rc1 = _; rc2 = _; direction = Conflict c; default_direction = _} ->
+            Trace.log (Printf.sprintf "[CONFLICT] Skipping %s\n  %s\n"
+                                      (Path.toString ri.path1) c)
+         | _ -> ()
+        )
+        newReconItemList;
     (skipped > 0, false, false, [])
   end else if proceed=ProceedImmediately then begin
     doit()


More information about the Unison-hackers mailing list