[Unison-hackers] [unison-svn] r513 - in trunk/src: . fsmonitor
vouillon at seas.upenn.edu
vouillon at seas.upenn.edu
Wed Sep 19 07:58:57 EDT 2012
Author: vouillon
Date: 2012-09-19 07:58:57 -0400 (Wed, 19 Sep 2012)
New Revision: 513
Modified:
trunk/src/RECENTNEWS
trunk/src/fsmonitor/watchercommon.ml
trunk/src/mkProjectInfo.ml
Log:
* Filesystem monitoring: do not use filters on maps, for compatibility
with OCaml 3.11
Modified: trunk/src/RECENTNEWS
===================================================================
--- trunk/src/RECENTNEWS 2012-09-18 16:10:59 UTC (rev 512)
+++ trunk/src/RECENTNEWS 2012-09-19 11:58:57 UTC (rev 513)
@@ -1,3 +1,9 @@
+CHANGES FROM VERSION 2.46.8
+
+* Filesystem monitoring: do not use filters on maps, for compatibility
+ with OCaml 3.11
+
+-------------------------------
CHANGES FROM VERSION 2.46.6
* A bytecode version of unison-fsmonitor is now produced by "make NATIVE=false"
Modified: trunk/src/fsmonitor/watchercommon.ml
===================================================================
--- trunk/src/fsmonitor/watchercommon.ml 2012-09-18 16:10:59 UTC (rev 512)
+++ trunk/src/fsmonitor/watchercommon.ml 2012-09-19 11:58:57 UTC (rev 513)
@@ -22,6 +22,11 @@
ignore(Sys.set_signal Sys.sigpipe Sys.Signal_ignore)
module StringMap = Map.Make(String)
+(*FIX: temporary workaround, as there is no StringMap.filter function
+ in OCaml 3.11 *)
+let stringmap_filter f m =
+ StringMap.fold (fun k v m' -> if f k v then StringMap.add k v m' else m')
+ m StringMap.empty
module StringSet = Set.Make(String)
module IntSet =
Set.Make
@@ -296,7 +301,7 @@
let rec clear_changes hash time =
let rec clear_rec f =
f.changed_children <-
- StringMap.filter
+ stringmap_filter
(fun nm (_, time_ref) ->
if time -. !time_ref <= delay then true else begin
remove_change f nm;
@@ -373,7 +378,7 @@
clear_event_memory ();
let rec gather_rec path r l =
let c =
- StringMap.filter (fun _ (_, time_ref) -> time -. !time_ref > delay)
+ stringmap_filter (fun _ (_, time_ref) -> time -. !time_ref > delay)
r.changed_children
in
let l = StringMap.fold (fun nm _ l -> concat path nm :: l) c l in
Modified: trunk/src/mkProjectInfo.ml
===================================================================
--- trunk/src/mkProjectInfo.ml 2012-09-18 16:10:59 UTC (rev 512)
+++ trunk/src/mkProjectInfo.ml 2012-09-19 11:58:57 UTC (rev 513)
@@ -85,3 +85,4 @@
+
More information about the Unison-hackers
mailing list