[Unison-hackers] [unison-svn] r510 - in trunk/src: . lwt/win

vouillon at seas.upenn.edu vouillon at seas.upenn.edu
Mon Sep 17 08:45:30 EDT 2012


Author: vouillon
Date: 2012-09-17 08:45:30 -0400 (Mon, 17 Sep 2012)
New Revision: 510

Modified:
   trunk/src/Makefile.OCaml
   trunk/src/RECENTNEWS
   trunk/src/fswatch.ml
   trunk/src/lwt/win/lwt_unix_impl.ml
   trunk/src/mkProjectInfo.ml
   trunk/src/uitext.ml
Log:
* Windows/lwt: correctly deals with Sys.Break exceptions when sleeping
* File system monitoring: improved search for unison-fsmonitor 
* File system monitoring: detect when the helper process exits
* Do not restart Unison in case of uncaught exception when the repeat
  preference is set.  This seems safer.  And it does not work, for
  instance, in case of lost connection.


Modified: trunk/src/Makefile.OCaml
===================================================================
--- trunk/src/Makefile.OCaml	2012-09-14 14:51:02 UTC (rev 509)
+++ trunk/src/Makefile.OCaml	2012-09-17 12:45:30 UTC (rev 510)
@@ -472,6 +472,7 @@
 	-$(RM) system/*.cm[iox] system/*.{o,obj} system/win/*~
 	-$(RM) system/generic/*.cm[iox] system/generic/*.{o,obj} system/generic/*~
 	-$(RM) system/win/*.cm[iox] system/win/*.{o,obj} system/win/*~
+	-$(RM) fsmonitor/*.cm[iox] fsmonitor/*.{o,obj}
 
 .PHONY: paths
 paths:

Modified: trunk/src/RECENTNEWS
===================================================================
--- trunk/src/RECENTNEWS	2012-09-14 14:51:02 UTC (rev 509)
+++ trunk/src/RECENTNEWS	2012-09-17 12:45:30 UTC (rev 510)
@@ -1,3 +1,13 @@
+CHANGES FROM VERSION 2.46.4
+
+* Windows/lwt: correctly deals with Sys.Break exceptions when sleeping
+* File system monitoring: improved search for unison-fsmonitor 
+* File system monitoring: detect when the helper process exits
+* Do not restart Unison in case of uncaught exception when the repeat
+  preference is set.  This seems safer.  And it does not work, for
+  instance, in case of lost connection.
+
+-------------------------------
 CHANGES FROM VERSION 2.46.3
 
 * Add a note to the 'new archives not identical' error message

Modified: trunk/src/fswatch.ml
===================================================================
--- trunk/src/fswatch.ml	2012-09-14 14:51:02 UTC (rev 509)
+++ trunk/src/fswatch.ml	2012-09-17 12:45:30 UTC (rev 510)
@@ -239,7 +239,8 @@
        path)
     name
 
-let exec_path =
+let exec_path = [System.fspathFromString Sys.executable_name]
+(*
   try
     (* Linux *)
     [System.fspathFromString (Unix.readlink "/proc/self/exe")]
@@ -254,6 +255,7 @@
         []
     else
       [System.fspathConcat (System.getcwd ()) name]
+*)
 
 let exec_dir = List.map System.fspathDirname exec_path
 
@@ -300,7 +302,9 @@
     Unix.close i1; Unix.close o2;
     ignore
       (Lwt.catch (fun () -> reader (read_line i2))
-         (fun e -> last_line := Exn e; Cond.signal has_line; Lwt.return ()));
+         (fun e ->
+            Cond.signal has_changes;
+            last_line := Exn e; Cond.signal has_line; Lwt.return ()));
     conn := Some o1;
     true
   with Not_found ->

Modified: trunk/src/lwt/win/lwt_unix_impl.ml
===================================================================
--- trunk/src/lwt/win/lwt_unix_impl.ml	2012-09-14 14:51:02 UTC (rev 509)
+++ trunk/src/lwt/win/lwt_unix_impl.ml	2012-09-17 12:45:30 UTC (rev 510)
@@ -230,7 +230,9 @@
       let i =
         try
           win_wait (truncate (ceil (delay *. 1000.))) !event_count
-        with e -> assert false
+        with
+          Sys.Break as e -> raise e
+        | _              -> assert false
       in
 if !d then Format.eprintf "^^^@.";
       if i = -1 then now := !now +. delay;

Modified: trunk/src/mkProjectInfo.ml
===================================================================
--- trunk/src/mkProjectInfo.ml	2012-09-14 14:51:02 UTC (rev 509)
+++ trunk/src/mkProjectInfo.ml	2012-09-17 12:45:30 UTC (rev 510)
@@ -83,3 +83,4 @@
 
 
 
+

Modified: trunk/src/uitext.ml
===================================================================
--- trunk/src/uitext.ml	2012-09-14 14:51:02 UTC (rev 509)
+++ trunk/src/uitext.ml	2012-09-17 12:45:30 UTC (rev 510)
@@ -860,8 +860,12 @@
   | e -> begin
       (* If any other bad thing happened and the -repeat preference is
          set, then restart *)
+      (* JV: it seems safer to just abort here, as we don't know in which
+         state Unison is; for instance, if the connection is lost, there
+         is no point in restarting as Unison will currently not attempt to
+         establish a new connection. *)
       handleException e;
-      if Prefs.read Uicommon.repeat <> "" then begin
+      if false (*Prefs.read Uicommon.repeat <> ""*) then begin
         Util.msg "Restarting in 10 seconds...\n";
         Unix.sleep 10;        
         start interface



More information about the Unison-hackers mailing list