From vouillon at seas.upenn.edu Fri Sep 14 04:54:50 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Fri, 14 Sep 2012 04:54:50 -0400 Subject: [Unison-hackers] [unison-svn] r507 - trunk/src Message-ID: <201209140854.q8E8soLV011977@yaws.seas.upenn.edu> Author: vouillon Date: 2012-09-14 04:54:50 -0400 (Fri, 14 Sep 2012) New Revision: 507 Modified: trunk/src/RECENTNEWS trunk/src/fswatch.ml trunk/src/mkProjectInfo.ml Log: * Fix Unix.readlink invalid argument error under Windows Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2012-08-09 14:30:22 UTC (rev 506) +++ trunk/src/RECENTNEWS 2012-09-14 08:54:50 UTC (rev 507) @@ -1,3 +1,8 @@ +CHANGES FROM VERSION 2.46.2 + +* Fix Unix.readlink invalid argument error under Windows + +------------------------------- CHANGES FROM VERSION 2.46.1 * More robust file watching helper programs for Windows and Linux. Modified: trunk/src/fswatch.ml =================================================================== --- trunk/src/fswatch.ml 2012-08-09 14:30:22 UTC (rev 506) +++ trunk/src/fswatch.ml 2012-09-14 08:54:50 UTC (rev 507) @@ -243,7 +243,7 @@ try (* Linux *) [System.fspathFromString (Unix.readlink "/proc/self/exe")] - with Unix.Unix_error _ -> + with Unix.Unix_error _ | Invalid_argument _ -> let name = (System.argv ()).(0) in if not (Filename.is_relative name) then [System.fspathFromString name] Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2012-08-09 14:30:22 UTC (rev 506) +++ trunk/src/mkProjectInfo.ml 2012-09-14 08:54:50 UTC (rev 507) @@ -81,3 +81,4 @@ + From bcpierce at seas.upenn.edu Fri Sep 14 10:50:07 2012 From: bcpierce at seas.upenn.edu (bcpierce at seas.upenn.edu) Date: Fri, 14 Sep 2012 10:50:07 -0400 Subject: [Unison-hackers] [unison-svn] r508 - in trunk: doc src Message-ID: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> Author: bcpierce Date: 2012-09-14 10:50:07 -0400 (Fri, 14 Sep 2012) New Revision: 508 Modified: trunk/doc/unison-manual.tex trunk/src/RECENTNEWS trunk/src/mkProjectInfo.ml trunk/src/update.ml Log: * Add a note to the 'new archives not identical' error message explaining that this can happen because Unison binaries compiled with OCaml 3 and OCaml 4 are incompatible. Modified: trunk/doc/unison-manual.tex =================================================================== --- trunk/doc/unison-manual.tex 2012-09-14 08:54:50 UTC (rev 507) +++ trunk/doc/unison-manual.tex 2012-09-14 14:50:07 UTC (rev 508) @@ -302,7 +302,7 @@ Once you've got OCaml installed, grab a copy of the Unison sources, unzip and untar them, change to the new \showtt{unison} directory, and -type ``{\tt make UISTYLE=text}.'' +type ``{\tt make UISTYLE=text}''. The result should be an executable file called \showtt{unison}. Type \showtt{./unison} to make sure the program is executable. You should get back a usage message. @@ -1865,7 +1865,8 @@ \item \verb|[xyz]| matches any character from the set $\{{\tt x}, {\tt y}, {\tt z} \}$ \item \verb|{a,bb,ccc}| matches any one of \verb|a|, \verb|bb|, or - \verb|ccc|. + \verb|ccc|. (Be careful not to put extra spaces after the commas: + these will be interpreted literally as part of the strings to be matched!) \end{itemize} \item The path separator in path patterns is always the Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2012-09-14 08:54:50 UTC (rev 507) +++ trunk/src/RECENTNEWS 2012-09-14 14:50:07 UTC (rev 508) @@ -1,3 +1,11 @@ +CHANGES FROM VERSION 2.46.3 + +* Add a note to the 'new archives not identical' error message + explaining that this can happen because Unison binaries compiled + with OCaml 3 and OCaml 4 are incompatible. + + +------------------------------- CHANGES FROM VERSION 2.46.2 * Fix Unix.readlink invalid argument error under Windows Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2012-09-14 08:54:50 UTC (rev 507) +++ trunk/src/mkProjectInfo.ml 2012-09-14 14:50:07 UTC (rev 508) @@ -82,3 +82,4 @@ + Modified: trunk/src/update.ml =================================================================== --- trunk/src/update.ml 2012-09-14 08:54:50 UTC (rev 507) +++ trunk/src/update.ml 2012-09-14 14:50:07 UTC (rev 508) @@ -757,6 +757,8 @@ "Internal error: On-disk archives are not identical.\n" ^ "\n" ^ "This can happen when both machines have the same hostname.\n" + ^ "It can also happen when one copy of Unison has been compiled with\n" + ^ "OCaml version 3 and one with OCaml version 4.\n" ^ "\n" ^ "If this is not the case and you get this message repeatedly, please:\n" ^ " a) Send a bug report to unison-users at yahoogroups.com (you may need\n" From bcpierce at seas.upenn.edu Fri Sep 14 10:51:03 2012 From: bcpierce at seas.upenn.edu (bcpierce at seas.upenn.edu) Date: Fri, 14 Sep 2012 10:51:03 -0400 Subject: [Unison-hackers] [unison-svn] r509 - branches/2.45/src Message-ID: <201209141451.q8EEp3tY024305@yaws.seas.upenn.edu> Author: bcpierce Date: 2012-09-14 10:51:02 -0400 (Fri, 14 Sep 2012) New Revision: 509 Modified: branches/2.45/src/NEWS branches/2.45/src/RECENTNEWS branches/2.45/src/mkProjectInfo.ml branches/2.45/src/strings.ml branches/2.45/src/update.ml Log: * Add a note to the 'new archives not identical' error message explaining that this can happen because Unison binaries compiled with OCaml 3 and OCaml 4 are incompatible. Modified: branches/2.45/src/NEWS =================================================================== --- branches/2.45/src/NEWS 2012-09-14 14:50:07 UTC (rev 508) +++ branches/2.45/src/NEWS 2012-09-14 14:51:02 UTC (rev 509) @@ -1,6 +1,64 @@ -Changes in Version 2.40.16 +Changes in Version 2.45.4 + Changes since 2.40.63: + * New preference fastercheckUNSAFE, which can be used (with care!) + to achieve much faster update detection when all the common files + in the two replicas are known to be identical. See the manual for + more information. + This feature should still be considered experimental, but it's + ready for other people to try out. + * Added option clientHostName. If specified, it will be used to as + the client host name, overriding UNISONLOCALHOSTNAME and the + actual host name. + * OS X GUI: + + fix crash under Lion, because of problems with the toolbar, + using the fix suggested in + http://blitzbasic.com/Community/posts.php?topic=95778. + + uimacnew09 is now the standard graphical interface on OSX + + A small improvement to the uimacnew09 interface from Alan + Schmitt and Steve Kalkwarf: when Unison is run with the + -batch flag, the interface will now automatically propagate + changes and terminate, without waiting for user interaction. + + Show a modal warning window if there is no archive for the + hosts. The user can then choose to exit or proceed (proceed + is the default). The window is not shown if the batch + preference is true. + + file details panel selectable + * GTK GUI: + + New version of uigtk2.ml from Matt Zagrabelny that + reorganizes the icons in a slightly more intuitive way. + * Minor fixes: + + Setting the prefer preference to older or newer now + propagates deletions when there is no conflict. + + Correctly quote the path when running merge commands. + + Add quotes to paths when calling external file watcher + utility. + + Incorporate a patch to fsmonitor.py (the external filewatcher + utility) from Tomasz Zernicki to make it work better under + Windows. + + Incorporated new version of fsmonitor.py from Christophe + Gohle + + Fixed incompatibility with OpenSSH 5.6. + + Fixed fingerprint cache: do not cache file properties + + Some spelling corrections in documentation and comments from + Stephane Glondu + + Fixed O_APPEND mode for open under Windows + + Fixed String.sub invalid argument error when an AppleDouble + file does not contain a finder information field + + Trim duplicate paths when using "-repeat watch" + + Unison now passes path arguments and -follow directives to + fsmonitor.py. This seems to work except for one small issue + with how fsmonitor.py treats -follow directives for + directories that don't exist (or maybe this is an issue with + how it treats any kind of monitoring when the thing being + monitored doesn't exist?). If we create a symlink to a + nonexistant directory, give Unison (hence fsmonitor.py) a + 'follow' directive for the symlink, start unison, and then + create the directory, fsmonitor.py misses the change. + + Lines added in profile files by unison always start at a new + line + Changes since 2.40.1: * Added "BelowPath" patterns, that match a path as well as all paths below (convenient to use with nodeletion,update,creationpartial @@ -1579,7 +1637,7 @@ changed. Instead of putting a line of the form ignore = in your profile (.unison/default.prf), you should put: - ignore = Regexp + ignore = Regex Moreover, two other styles of pattern are also recognized: ignore = Name matches any path in which one component matches , while Modified: branches/2.45/src/RECENTNEWS =================================================================== --- branches/2.45/src/RECENTNEWS 2012-09-14 14:50:07 UTC (rev 508) +++ branches/2.45/src/RECENTNEWS 2012-09-14 14:51:02 UTC (rev 509) @@ -1,3 +1,11 @@ +CHANGES FROM VERSION 2.45.5 + +* Add a note to the 'new archives not identical' error message + explaining that this can happen because Unison binaries compiled + with OCaml 3 and OCaml 4 are incompatible. + + +------------------------------- CHANGES FROM VERSION 2.45.4 - fix a bug in the lookup of the remote host name Modified: branches/2.45/src/mkProjectInfo.ml =================================================================== --- branches/2.45/src/mkProjectInfo.ml 2012-09-14 14:50:07 UTC (rev 508) +++ branches/2.45/src/mkProjectInfo.ml 2012-09-14 14:51:02 UTC (rev 509) @@ -68,3 +68,4 @@ + Modified: branches/2.45/src/strings.ml =================================================================== --- branches/2.45/src/strings.ml 2012-09-14 14:50:07 UTC (rev 508) +++ branches/2.45/src/strings.ml 2012-09-14 14:51:02 UTC (rev 509) @@ -4,7 +4,7 @@ let docs = ("about", ("About Unison", "Unison File Synchronizer\n\ - Version 2.40.16\n\ + Version 2.45.4\n\ \n\ ")) :: @@ -272,6 +272,8 @@ \n\ \032 You'll also need the GNU make utility, standard on many Unix systems.\n\ \032 (Type \"make -version\" to check that you've got the GNU version.)\n\ + \032 Unison's build system is not parallelizable, so don't use make flags\n\ + \032 which cause it to start processes in parallel, e.g. -j for GNU make.\n\ \n\ \032 Once you've got OCaml installed, grab a copy of the Unison sources,\n\ \032 unzip and untar them, change to the new \"unison\" directory, and type\n\ @@ -537,10 +539,8 @@ \n\ \032 The standard remote shell facility on Unix systems is ssh, which\n\ \032 provides the same functionality as the older rsh but much better\n\ - \032 security. Ssh is available from ftp://ftp.cs.hut.fi/pub/ssh/;\n\ - \032 up-to-date binaries for some architectures can also be found at\n\ - \032 ftp://ftp.faqs.org/ssh/contrib. See section [1]A.2 for installation\n\ - \032 instructions for the Windows version.\n\ + \032 security. Ssh is available from http://www.openssh.org. See\n\ + \032 section [1]A.2 for installation instructions for the Windows version.\n\ \n\ \032 Running ssh requires some coordination between the client and server\n\ \032 machines to establish that the client is allowed to invoke commands on\n\ @@ -2170,7 +2170,7 @@ \032 the replicas. (These three options are provided for later\n\ \032 compatibility with the Harmony data synchronizer.)\n\ \n\ - \032 To accomodate the wide variety of programs that users might want to\n\ + \032 To accommodate the wide variety of programs that users might want to\n\ \032 use for merging, Unison checks for several possible situations when\n\ \032 the merge program exits:\n\ \032 * If the merge program exits with a non-zero status, then merge is\n\ @@ -2678,9 +2678,8 @@ \032 and \"Add to Start Menu.\" You make the call.\n\ \032 d. You can now delete the directory Foo and its contents.\n\ \032 Some people have reported problems using Cygwin's ssh with Unison.\n\ - \032 If you have trouble, you might try this one instead:\n\ - \032 http://opensores.thebunker.net/pub/mirrors/ssh/contrib/ssh-1.2.14-win32bin.zi\n\ - p\n\ + \032 If you have trouble, you might try other ones instead:\n\ + \032 http://linuxmafia.com/ssh/win32.html\n\ \032 2. You must set the environment variables HOME and PATH. Ssh will\n\ \032 create a directory .ssh in the directory given by HOME, so that it\n\ \032 has a place to keep data like your public and private keys. PATH\n\ @@ -2718,9 +2717,67 @@ \n\ ")) :: - ("news", ("Changes in Version 2.40.16", - "Changes in Version 2.40.16\n\ + ("news", ("Changes in Version 2.45.4", + "Changes in Version 2.45.4\n\ \n\ + \032 Changes since 2.40.63:\n\ + \032 * New preference fastercheckUNSAFE, which can be used (with care!)\n\ + \032 to achieve much faster update detection when all the common files\n\ + \032 in the two replicas are known to be identical. See the manual for\n\ + \032 more information.\n\ + \032 This feature should still be considered experimental, but it's\n\ + \032 ready for other people to try out.\n\ + \032 * Added option clientHostName. If specified, it will be used to as\n\ + \032 the client host name, overriding UNISONLOCALHOSTNAME and the\n\ + \032 actual host name.\n\ + \032 * OS X GUI:\n\ + \032 + fix crash under Lion, because of problems with the toolbar,\n\ + \032 using the fix suggested in\n\ + \032 http://blitzbasic.com/Community/posts.php?topic=95778.\n\ + \032 + uimacnew09 is now the standard graphical interface on OSX\n\ + \032 + A small improvement to the uimacnew09 interface from Alan\n\ + \032 Schmitt and Steve Kalkwarf: when Unison is run with the\n\ + \032 -batch flag, the interface will now automatically propagate\n\ + \032 changes and terminate, without waiting for user interaction.\n\ + \032 + Show a modal warning window if there is no archive for the\n\ + \032 hosts. The user can then choose to exit or proceed (proceed\n\ + \032 is the default). The window is not shown if the batch\n\ + \032 preference is true.\n\ + \032 + file details panel selectable\n\ + \032 * GTK GUI:\n\ + \032 + New version of uigtk2.ml from Matt Zagrabelny that\n\ + \032 reorganizes the icons in a slightly more intuitive way.\n\ + \032 * Minor fixes:\n\ + \032 + Setting the prefer preference to older or newer now\n\ + \032 propagates deletions when there is no conflict.\n\ + \032 + Correctly quote the path when running merge commands.\n\ + \032 + Add quotes to paths when calling external file watcher\n\ + \032 utility.\n\ + \032 + Incorporate a patch to fsmonitor.py (the external filewatcher\n\ + \032 utility) from Tomasz Zernicki to make it work better under\n\ + \032 Windows.\n\ + \032 + Incorporated new version of fsmonitor.py from Christophe\n\ + \032 Gohle\n\ + \032 + Fixed incompatibility with OpenSSH 5.6.\n\ + \032 + Fixed fingerprint cache: do not cache file properties\n\ + \032 + Some spelling corrections in documentation and comments from\n\ + \032 Stephane Glondu\n\ + \032 + Fixed O_APPEND mode for open under Windows\n\ + \032 + Fixed String.sub invalid argument error when an AppleDouble\n\ + \032 file does not contain a finder information field\n\ + \032 + Trim duplicate paths when using \"-repeat watch\"\n\ + \032 + Unison now passes path arguments and -follow directives to\n\ + \032 fsmonitor.py. This seems to work except for one small issue\n\ + \032 with how fsmonitor.py treats -follow directives for\n\ + \032 directories that don't exist (or maybe this is an issue with\n\ + \032 how it treats any kind of monitoring when the thing being\n\ + \032 monitored doesn't exist?). If we create a symlink to a\n\ + \032 nonexistant directory, give Unison (hence fsmonitor.py) a\n\ + \032 'follow' directive for the symlink, start unison, and then\n\ + \032 create the directory, fsmonitor.py misses the change.\n\ + \032 + Lines added in profile files by unison always start at a new\n\ + \032 line\n\ + \n\ \032 Changes since 2.40.1:\n\ \032 * Added \"BelowPath\" patterns, that match a path as well as all paths\n\ \032 below (convenient to use with nodeletion,update,creationpartial\n\ @@ -2783,7 +2840,7 @@ \032 and is not slowed done due to the connection latency anymore\n\ \032 + we get performance improvement for small files as well by\n\ \032 scheduling many files simultaneously (as scheduling a file\n\ - \032 for transfer consume little resource: it does not mean\n\ + \032 for transfer consume little ressource: it does not mean\n\ \032 allocating a large buffer anymore)\n\ \032 * Changes to the internal implementation of the rsync algorithm:\n\ \032 + use longer blocks for large files (the size of a block is the\n\ @@ -4299,7 +4356,7 @@ \032 changed. Instead of putting a line of the form\n\ \032 ignore = \n\ \032 in your profile (.unison/default.prf), you should put:\n\ - \032 ignore = Regexp \n\ + \032 ignore = Regex \n\ \032 Moreover, two other styles of pattern are also recognized:\n\ \032 ignore = Name \n\ \032 matches any path in which one component matches , while\n\ @@ -4382,7 +4439,7 @@ \n\ References\n\ \n\ - \032 1. file://localhost/Users/bcpierce/current/unison/trunk/doc/temp.html#ssh-win\n\ + \032 1. file://localhost/Users/bcpierce/current/unison/branches/2.45/doc/temp.html#ssh-win\n\ \032 2. http://pauillac.inria.fr/~maranget/hevea/index.html\n\ ")) :: Modified: branches/2.45/src/update.ml =================================================================== --- branches/2.45/src/update.ml 2012-09-14 14:50:07 UTC (rev 508) +++ branches/2.45/src/update.ml 2012-09-14 14:51:02 UTC (rev 509) @@ -757,6 +757,8 @@ "Internal error: On-disk archives are not identical.\n" ^ "\n" ^ "This can happen when both machines have the same hostname.\n" + ^ "It can also happen when one copy of Unison has been compiled with\n" + ^ "OCaml version 3 and one with OCaml version 4.\n" ^ "\n" ^ "If this is not the case and you get this message repeatedly, please:\n" ^ " a) Send a bug report to unison-users at yahoogroups.com (you may need\n" From Jerome.Vouillon at pps.jussieu.fr Fri Sep 14 11:34:42 2012 From: Jerome.Vouillon at pps.jussieu.fr (Jerome Vouillon) Date: Fri, 14 Sep 2012 17:34:42 +0200 Subject: [Unison-hackers] [unison-svn] r508 - in trunk: doc src In-Reply-To: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> References: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> Message-ID: <20120914153442.GA18472@pps.jussieu.fr> Hi Benjamin, > * Add a note to the 'new archives not identical' error message > explaining that this can happen because Unison binaries compiled > with OCaml 3 and OCaml 4 are incompatible. Maybe we should release a modified stable version of Unison that always uses the old hash function? That should not be too much work, and should prevent most incompatibility issues. As an alternative, the Unison client could try with both hash functions, but that's a lot more work to implement. (In particular, we would have to include an implementation of the new hash function in Unison.) What do you think? -- Jerome From bcpierce at cis.upenn.edu Fri Sep 14 11:45:39 2012 From: bcpierce at cis.upenn.edu (Benjamin Pierce) Date: Fri, 14 Sep 2012 11:45:39 -0400 Subject: [Unison-hackers] [unison-svn] r508 - in trunk: doc src In-Reply-To: <20120914153442.GA18472@pps.jussieu.fr> References: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> <20120914153442.GA18472@pps.jussieu.fr> Message-ID: And then just assume that anybody compiling the beta or developer versions is going to be using OCaml 4? Yes, that might be a reasonable compromise. - B On Sep 14, 2012, at 11:34, Jerome Vouillon wrote: > Hi Benjamin, > >> * Add a note to the 'new archives not identical' error message >> explaining that this can happen because Unison binaries compiled >> with OCaml 3 and OCaml 4 are incompatible. > > Maybe we should release a modified stable version of Unison that > always uses the old hash function? That should not be too much work, > and should prevent most incompatibility issues. > > As an alternative, the Unison client could try with both hash > functions, but that's a lot more work to implement. (In particular, we > would have to include an implementation of the new hash function in > Unison.) > > What do you think? > > -- Jerome > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers From vouillon at seas.upenn.edu Mon Sep 17 08:45:30 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Mon, 17 Sep 2012 08:45:30 -0400 Subject: [Unison-hackers] [unison-svn] r510 - in trunk/src: . lwt/win Message-ID: <201209171245.q8HCjVZQ025296@yaws.seas.upenn.edu> 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 From vouillon at seas.upenn.edu Mon Sep 17 10:09:03 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Mon, 17 Sep 2012 10:09:03 -0400 Subject: [Unison-hackers] [unison-svn] r511 - branches/2.40/src Message-ID: <201209171409.q8HE93Kn027635@yaws.seas.upenn.edu> Author: vouillon Date: 2012-09-17 10:09:03 -0400 (Mon, 17 Sep 2012) New Revision: 511 Modified: branches/2.40/src/Makefile.OCaml branches/2.40/src/RECENTNEWS branches/2.40/src/case.ml branches/2.40/src/fspath.ml branches/2.40/src/fspath.mli branches/2.40/src/mkProjectInfo.ml branches/2.40/src/path.ml branches/2.40/src/path.mli branches/2.40/src/props.ml branches/2.40/src/update.ml branches/2.40/src/uutil.ml branches/2.40/src/uutil.mli Log: * Use hash function from OCaml 3.x for comparing archives, even when compiled with OCaml 4.x Modified: branches/2.40/src/Makefile.OCaml =================================================================== --- branches/2.40/src/Makefile.OCaml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/Makefile.OCaml 2012-09-17 14:09:03 UTC (rev 511) @@ -217,7 +217,7 @@ lwt/pqueue.cmo lwt/lwt.cmo lwt/lwt_util.cmo \ lwt/$(SYSTEM)/lwt_unix_impl.cmo lwt/lwt_unix.cmo \ \ - case.cmo pred.cmo uutil.cmo \ + uutil.cmo case.cmo pred.cmo \ fileutil.cmo name.cmo path.cmo fspath.cmo fs.cmo fingerprint.cmo \ abort.cmo osx.cmo external.cmo \ props.cmo fileinfo.cmo os.cmo lock.cmo clroot.cmo common.cmo \ Modified: branches/2.40/src/RECENTNEWS =================================================================== --- branches/2.40/src/RECENTNEWS 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/RECENTNEWS 2012-09-17 14:09:03 UTC (rev 511) @@ -1,3 +1,9 @@ +CHANGES FROM VERSION 2.40.69 + +* Use hash function from OCaml 3.x for comparing archives, even when + compiled with OCaml 4.x + +------------------------------- CHANGES FROM VERSION 2.40.65 - uimacnew09: make file details panel selectable Modified: branches/2.40/src/case.ml =================================================================== --- branches/2.40/src/case.ml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/case.ml 2012-09-17 14:09:03 UTC (rev 511) @@ -140,7 +140,7 @@ method mode = Sensitive method modeDesc = "case sensitive" method compare s s' = compare (s : string) s' - method hash s = Hashtbl.hash s + method hash s = Uutil.hash s method normalizePattern s = s method caseInsensitiveMatch = false method normalizeMatchedString s = s @@ -152,7 +152,7 @@ method mode = Insensitive method modeDesc = "Latin-1 case insensitive" method compare s s' = Util.nocase_cmp s s' - method hash s = Hashtbl.hash (String.lowercase s) + method hash s = Uutil.hash (String.lowercase s) method normalizePattern s = s method caseInsensitiveMatch = true method normalizeMatchedString s = s @@ -164,7 +164,7 @@ method mode = UnicodeSensitive method modeDesc = "Unicode case sensitive" method compare s s' = Unicode.case_sensitive_compare s s' - method hash s = Hashtbl.hash (Unicode.decompose s) + method hash s = Uutil.hash (Unicode.decompose s) method normalizePattern p = Unicode.decompose p method caseInsensitiveMatch = false method normalizeMatchedString s = Unicode.decompose s @@ -176,7 +176,7 @@ method mode = UnicodeInsensitive method modeDesc = "Unicode case insensitive" method compare s s' = Unicode.case_insensitive_compare s s' - method hash s = Hashtbl.hash (Unicode.normalize s) + method hash s = Uutil.hash (Unicode.normalize s) method normalizePattern p = Unicode.normalize p method caseInsensitiveMatch = false method normalizeMatchedString s = Unicode.normalize s Modified: branches/2.40/src/fspath.ml =================================================================== --- branches/2.40/src/fspath.ml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/fspath.ml 2012-09-17 14:09:03 UTC (rev 511) @@ -335,4 +335,3 @@ let quotes (Fspath f) = Uutil.quotes f let compare (Fspath f1) (Fspath f2) = compare f1 f2 -let hash (Fspath f) = Hashtbl.hash f Modified: branches/2.40/src/fspath.mli =================================================================== --- branches/2.40/src/fspath.mli 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/fspath.mli 2012-09-17 14:09:03 UTC (rev 511) @@ -33,5 +33,3 @@ (* CASE-SENSITIVE comparison between fspaths *) val compare : t -> t -> int -(* CASE-SENSITIVE hash of a fspath *) -val hash : t -> int Modified: branches/2.40/src/mkProjectInfo.ml =================================================================== --- branches/2.40/src/mkProjectInfo.ml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/mkProjectInfo.ml 2012-09-17 14:09:03 UTC (rev 511) @@ -99,3 +99,4 @@ + Modified: branches/2.40/src/path.ml =================================================================== --- branches/2.40/src/path.ml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/path.ml 2012-09-17 14:09:03 UTC (rev 511) @@ -202,10 +202,6 @@ assert (not (isEmpty path)); prefix ^ path -(* No need to perform case normalization on local paths *) -let hash p = Hashtbl.hash p -let equal (p1 : local) (p2 : local) = p1 = p2 - (* Pref controlling whether symlinks are followed. *) let followPred = Pred.create ~advanced:true "follow" ("Including the preference \\texttt{-follow \\ARG{pathspec}} causes Unison to \ Modified: branches/2.40/src/path.mli =================================================================== --- branches/2.40/src/path.mli 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/path.mli 2012-09-17 14:09:03 UTC (rev 511) @@ -31,8 +31,6 @@ val addPrefixToFinalName : local -> string -> local val compare : t -> t -> int -val equal : local -> local -> bool -val hash : local -> int val followLink : local -> bool val followPred : Pred.t Modified: branches/2.40/src/props.ml =================================================================== --- branches/2.40/src/props.ml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/props.ml 2012-09-17 14:09:03 UTC (rev 511) @@ -305,7 +305,7 @@ (match id with IdIgnored -> -1 | IdNumeric i -> i - | IdNamed nm -> Hashtbl.hash nm) + | IdNamed nm -> Uutil.hash nm) h let similar id id' = @@ -609,7 +609,7 @@ let dummy = None -let hash t h = Uutil.hash2 (Hashtbl.hash t) h +let hash t h = Uutil.hash2 (Uutil.hash t) h let similar t t' = not (Prefs.read Osx.rsrc) || t = t' Modified: branches/2.40/src/update.ml =================================================================== --- branches/2.40/src/update.ml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/update.ml 2012-09-17 14:09:03 UTC (rev 511) @@ -248,9 +248,9 @@ (checkArchive false (n :: path) a h)) children (Props.hash desc h) | ArchiveFile (desc, dig, _, ress) -> - Uutil.hash2 (Hashtbl.hash dig) (Props.hash desc h) + Uutil.hash2 (Uutil.hash dig) (Props.hash desc h) | ArchiveSymlink content -> - Uutil.hash2 (Hashtbl.hash content) h + Uutil.hash2 (Uutil.hash content) h | NoArchive -> 135 Modified: branches/2.40/src/uutil.ml =================================================================== --- branches/2.40/src/uutil.ml 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/uutil.ml 2012-09-17 14:09:03 UTC (rev 511) @@ -34,6 +34,10 @@ let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF +external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" + +let hash x = hash_param 10 100 x + (*****************************************************************************) (* File sizes *) (*****************************************************************************) Modified: branches/2.40/src/uutil.mli =================================================================== --- branches/2.40/src/uutil.mli 2012-09-17 12:45:30 UTC (rev 510) +++ branches/2.40/src/uutil.mli 2012-09-17 14:09:03 UTC (rev 511) @@ -13,6 +13,8 @@ (* Hashing *) val hash2 : int -> int -> int +(* Hash function (OCaml 3.x version) *) +val hash : 'a -> int module type FILESIZE = sig type t From bcpierce at cis.upenn.edu Mon Sep 17 10:30:02 2012 From: bcpierce at cis.upenn.edu (Benjamin C. Pierce) Date: Mon, 17 Sep 2012 10:30:02 -0400 Subject: [Unison-hackers] [unison-svn] r511 - branches/2.40/src In-Reply-To: <201209171409.q8HE93Kn027635@yaws.seas.upenn.edu> References: <201209171409.q8HE93Kn027635@yaws.seas.upenn.edu> Message-ID: Excellent -- many thanks, J?rome! Explanation for others: Our plan is to replace the stable 2.40 with this version, which should interact well with other 2.40 installations even if they've been built with OCaml 3 and this one is built with OCaml 4. Before I replace the stable version with this update, it would be great if some other people can give it a try. So if you're using Unison 2.40 and don't mind compiling from source -- and *especially* if you have OCaml 3 on one machine and OCaml 4 on another -- please grab the one now in the svn repo... svn checkout https://webdav.seas.upenn.edu/svn/unison/branches/2.40 ? and see if it works well for you. - Benjamin On Sep 17, 2012, at 10:09 AM, vouillon at seas.upenn.edu wrote: > Author: vouillon > Date: 2012-09-17 10:09:03 -0400 (Mon, 17 Sep 2012) > New Revision: 511 > > Modified: > branches/2.40/src/Makefile.OCaml > branches/2.40/src/RECENTNEWS > branches/2.40/src/case.ml > branches/2.40/src/fspath.ml > branches/2.40/src/fspath.mli > branches/2.40/src/mkProjectInfo.ml > branches/2.40/src/path.ml > branches/2.40/src/path.mli > branches/2.40/src/props.ml > branches/2.40/src/update.ml > branches/2.40/src/uutil.ml > branches/2.40/src/uutil.mli > Log: > * Use hash function from OCaml 3.x for comparing archives, even when > compiled with OCaml 4.x > > > Modified: branches/2.40/src/Makefile.OCaml > =================================================================== > --- branches/2.40/src/Makefile.OCaml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/Makefile.OCaml 2012-09-17 14:09:03 UTC (rev 511) > @@ -217,7 +217,7 @@ > lwt/pqueue.cmo lwt/lwt.cmo lwt/lwt_util.cmo \ > lwt/$(SYSTEM)/lwt_unix_impl.cmo lwt/lwt_unix.cmo \ > \ > - case.cmo pred.cmo uutil.cmo \ > + uutil.cmo case.cmo pred.cmo \ > fileutil.cmo name.cmo path.cmo fspath.cmo fs.cmo fingerprint.cmo \ > abort.cmo osx.cmo external.cmo \ > props.cmo fileinfo.cmo os.cmo lock.cmo clroot.cmo common.cmo \ > > Modified: branches/2.40/src/RECENTNEWS > =================================================================== > --- branches/2.40/src/RECENTNEWS 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/RECENTNEWS 2012-09-17 14:09:03 UTC (rev 511) > @@ -1,3 +1,9 @@ > +CHANGES FROM VERSION 2.40.69 > + > +* Use hash function from OCaml 3.x for comparing archives, even when > + compiled with OCaml 4.x > + > +------------------------------- > CHANGES FROM VERSION 2.40.65 > > - uimacnew09: make file details panel selectable > > Modified: branches/2.40/src/case.ml > =================================================================== > --- branches/2.40/src/case.ml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/case.ml 2012-09-17 14:09:03 UTC (rev 511) > @@ -140,7 +140,7 @@ > method mode = Sensitive > method modeDesc = "case sensitive" > method compare s s' = compare (s : string) s' > - method hash s = Hashtbl.hash s > + method hash s = Uutil.hash s > method normalizePattern s = s > method caseInsensitiveMatch = false > method normalizeMatchedString s = s > @@ -152,7 +152,7 @@ > method mode = Insensitive > method modeDesc = "Latin-1 case insensitive" > method compare s s' = Util.nocase_cmp s s' > - method hash s = Hashtbl.hash (String.lowercase s) > + method hash s = Uutil.hash (String.lowercase s) > method normalizePattern s = s > method caseInsensitiveMatch = true > method normalizeMatchedString s = s > @@ -164,7 +164,7 @@ > method mode = UnicodeSensitive > method modeDesc = "Unicode case sensitive" > method compare s s' = Unicode.case_sensitive_compare s s' > - method hash s = Hashtbl.hash (Unicode.decompose s) > + method hash s = Uutil.hash (Unicode.decompose s) > method normalizePattern p = Unicode.decompose p > method caseInsensitiveMatch = false > method normalizeMatchedString s = Unicode.decompose s > @@ -176,7 +176,7 @@ > method mode = UnicodeInsensitive > method modeDesc = "Unicode case insensitive" > method compare s s' = Unicode.case_insensitive_compare s s' > - method hash s = Hashtbl.hash (Unicode.normalize s) > + method hash s = Uutil.hash (Unicode.normalize s) > method normalizePattern p = Unicode.normalize p > method caseInsensitiveMatch = false > method normalizeMatchedString s = Unicode.normalize s > > Modified: branches/2.40/src/fspath.ml > =================================================================== > --- branches/2.40/src/fspath.ml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/fspath.ml 2012-09-17 14:09:03 UTC (rev 511) > @@ -335,4 +335,3 @@ > > let quotes (Fspath f) = Uutil.quotes f > let compare (Fspath f1) (Fspath f2) = compare f1 f2 > -let hash (Fspath f) = Hashtbl.hash f > > Modified: branches/2.40/src/fspath.mli > =================================================================== > --- branches/2.40/src/fspath.mli 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/fspath.mli 2012-09-17 14:09:03 UTC (rev 511) > @@ -33,5 +33,3 @@ > > (* CASE-SENSITIVE comparison between fspaths *) > val compare : t -> t -> int > -(* CASE-SENSITIVE hash of a fspath *) > -val hash : t -> int > > Modified: branches/2.40/src/mkProjectInfo.ml > =================================================================== > --- branches/2.40/src/mkProjectInfo.ml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/mkProjectInfo.ml 2012-09-17 14:09:03 UTC (rev 511) > @@ -99,3 +99,4 @@ > > > > + > > Modified: branches/2.40/src/path.ml > =================================================================== > --- branches/2.40/src/path.ml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/path.ml 2012-09-17 14:09:03 UTC (rev 511) > @@ -202,10 +202,6 @@ > assert (not (isEmpty path)); > prefix ^ path > > -(* No need to perform case normalization on local paths *) > -let hash p = Hashtbl.hash p > -let equal (p1 : local) (p2 : local) = p1 = p2 > - > (* Pref controlling whether symlinks are followed. *) > let followPred = Pred.create ~advanced:true "follow" > ("Including the preference \\texttt{-follow \\ARG{pathspec}} causes Unison to \ > > Modified: branches/2.40/src/path.mli > =================================================================== > --- branches/2.40/src/path.mli 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/path.mli 2012-09-17 14:09:03 UTC (rev 511) > @@ -31,8 +31,6 @@ > val addPrefixToFinalName : local -> string -> local > > val compare : t -> t -> int > -val equal : local -> local -> bool > -val hash : local -> int > > val followLink : local -> bool > val followPred : Pred.t > > Modified: branches/2.40/src/props.ml > =================================================================== > --- branches/2.40/src/props.ml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/props.ml 2012-09-17 14:09:03 UTC (rev 511) > @@ -305,7 +305,7 @@ > (match id with > IdIgnored -> -1 > | IdNumeric i -> i > - | IdNamed nm -> Hashtbl.hash nm) > + | IdNamed nm -> Uutil.hash nm) > h > > let similar id id' = > @@ -609,7 +609,7 @@ > > let dummy = None > > -let hash t h = Uutil.hash2 (Hashtbl.hash t) h > +let hash t h = Uutil.hash2 (Uutil.hash t) h > > let similar t t' = > not (Prefs.read Osx.rsrc) || t = t' > > Modified: branches/2.40/src/update.ml > =================================================================== > --- branches/2.40/src/update.ml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/update.ml 2012-09-17 14:09:03 UTC (rev 511) > @@ -248,9 +248,9 @@ > (checkArchive false (n :: path) a h)) > children (Props.hash desc h) > | ArchiveFile (desc, dig, _, ress) -> > - Uutil.hash2 (Hashtbl.hash dig) (Props.hash desc h) > + Uutil.hash2 (Uutil.hash dig) (Props.hash desc h) > | ArchiveSymlink content -> > - Uutil.hash2 (Hashtbl.hash content) h > + Uutil.hash2 (Uutil.hash content) h > | NoArchive -> > 135 > > > Modified: branches/2.40/src/uutil.ml > =================================================================== > --- branches/2.40/src/uutil.ml 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/uutil.ml 2012-09-17 14:09:03 UTC (rev 511) > @@ -34,6 +34,10 @@ > > let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF > > +external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" > + > +let hash x = hash_param 10 100 x > + > (*****************************************************************************) > (* File sizes *) > (*****************************************************************************) > > Modified: branches/2.40/src/uutil.mli > =================================================================== > --- branches/2.40/src/uutil.mli 2012-09-17 12:45:30 UTC (rev 510) > +++ branches/2.40/src/uutil.mli 2012-09-17 14:09:03 UTC (rev 511) > @@ -13,6 +13,8 @@ > > (* Hashing *) > val hash2 : int -> int -> int > +(* Hash function (OCaml 3.x version) *) > +val hash : 'a -> int > > module type FILESIZE = sig > type t > > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers From vouillon at seas.upenn.edu Tue Sep 18 12:10:59 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Tue, 18 Sep 2012 12:10:59 -0400 Subject: [Unison-hackers] [unison-svn] r512 - in trunk/src: . fsmonitor/linux fsmonitor/windows Message-ID: <201209181611.q8IGB09T011038@yaws.seas.upenn.edu> Author: vouillon Date: 2012-09-18 12:10:59 -0400 (Tue, 18 Sep 2012) New Revision: 512 Modified: trunk/src/RECENTNEWS trunk/src/fsmonitor/linux/Makefile trunk/src/fsmonitor/windows/Makefile trunk/src/mkProjectInfo.ml Log: * A bytecode version of unison-fsmonitor is now produced by "make NATIVE=false" Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2012-09-17 14:09:03 UTC (rev 511) +++ trunk/src/RECENTNEWS 2012-09-18 16:10:59 UTC (rev 512) @@ -1,3 +1,8 @@ +CHANGES FROM VERSION 2.46.6 + +* A bytecode version of unison-fsmonitor is now produced by "make NATIVE=false" + +------------------------------- CHANGES FROM VERSION 2.46.4 * Windows/lwt: correctly deals with Sys.Break exceptions when sleeping Modified: trunk/src/fsmonitor/linux/Makefile =================================================================== --- trunk/src/fsmonitor/linux/Makefile 2012-09-17 14:09:03 UTC (rev 511) +++ trunk/src/fsmonitor/linux/Makefile 2012-09-18 16:10:59 UTC (rev 512) @@ -2,19 +2,27 @@ FSMONITOR = $(NAME)-fsmonitor DIR=fsmonitor/linux -FSMCAMLOBJS = \ - lwt/lwt.cmx lwt/pqueue.cmx lwt/generic/lwt_unix_impl.cmx lwt/lwt_unix.cmx \ - $(DIR)/inotify.cmx $(DIR)/lwt_inotify.cmx \ - fsmonitor/watchercommon.cmx $(DIR)/watcher.cmx +FSMOCAMLOBJS = \ + lwt/lwt.cmo lwt/pqueue.cmo lwt/generic/lwt_unix_impl.cmo lwt/lwt_unix.cmo \ + $(DIR)/inotify.cmo $(DIR)/lwt_inotify.cmo \ + fsmonitor/watchercommon.cmo $(DIR)/watcher.cmo FSMCOBJS = \ $(DIR)/inotify_stubs.o -FSMCAMLLIBS=unix.cmxa +FSMOCAMLLIBS=unix.cma +ifeq ($(NATIVE), true) + FSMCAMLOBJS=$(subst .cmo,.cmx, $(FSMOCAMLOBJS)) + FSMCAMLLIBS=$(subst .cma,.cmxa, $(FSMOCAMLLIBS)) +else + FSMCAMLOBJS=$(FSMOCAMLOBJS) + FSMCAMLLIBS=$(FSMOCAMLLIBS) +endif + buildexecutable:: $(FSMONITOR)$(EXEC_EXT) $(FSMONITOR)$(EXEC_EXT): $(FSMCAMLOBJS) $(FSMCOBJS) @echo Linking $@ - $(OCAMLOPT) -verbose $(CAMLFLAGS) -o $@ $(CFLAGS) $(FSMCAMLLIBS) $^ $(CLIBS) + $(CAMLC) -verbose $(CAMLFLAGS) -o $@ $(CFLAGS) $(FSMCAMLLIBS) $^ $(CLIBS) clean:: rm -f $(DIR)/*.cm[iox] $(DIR)/*.o $(DIR)/*~ Modified: trunk/src/fsmonitor/windows/Makefile =================================================================== --- trunk/src/fsmonitor/windows/Makefile 2012-09-17 14:09:03 UTC (rev 511) +++ trunk/src/fsmonitor/windows/Makefile 2012-09-18 16:10:59 UTC (rev 512) @@ -2,22 +2,30 @@ FSMONITOR = $(NAME)-fsmonitor DIR=fsmonitor/windows -FSMCAMLOBJS = \ - ubase/rx.cmx unicode_tables.cmx unicode.cmx \ - system/system_generic.cmx system/system_win.cmx \ - system/win/system_impl.cmx \ - lwt/lwt.cmx lwt/pqueue.cmx lwt/win/lwt_unix_impl.cmx lwt/lwt_unix.cmx \ - lwt/win/lwt_win.cmx \ - $(DIR)/shortnames.cmx fsmonitor/watchercommon.cmx $(DIR)/watcher.cmx +FSMOCAMLOBJS = \ + ubase/rx.cmo unicode_tables.cmo unicode.cmo \ + system/system_generic.cmo system/system_win.cmo \ + system/win/system_impl.cmo \ + lwt/lwt.cmo lwt/pqueue.cmo lwt/win/lwt_unix_impl.cmo lwt/lwt_unix.cmo \ + lwt/win/lwt_win.cmo \ + $(DIR)/shortnames.cmo fsmonitor/watchercommon.cmo $(DIR)/watcher.cmo FSMCOBJS = \ system/system_win_stubs.o lwt/lwt_unix_stubs.o $(DIR)/shortnames_stubs.o -FSMCAMLLIBS=bigarray.cmxa unix.cmxa +FSMOCAMLLIBS=bigarray.cma unix.cma +ifeq ($(NATIVE), true) + FSMCAMLOBJS=$(subst .cmo,.cmx, $(FSMOCAMLOBJS)) + FSMCAMLLIBS=$(subst .cma,.cmxa, $(FSMOCAMLLIBS)) +else + FSMCAMLOBJS=$(FSMOCAMLOBJS) + FSMCAMLLIBS=$(FSMOCAMLLIBS) +endif + buildexecutable:: $(FSMONITOR)$(EXEC_EXT) $(FSMONITOR)$(EXEC_EXT): $(FSMCAMLOBJS) $(FSMCOBJS) @echo Linking $@ - $(OCAMLOPT) -verbose $(CAMLFLAGS) -o $@ $(CFLAGS) $(FSMCAMLLIBS) $^ $(CLIBS) + $(CAMLC) -verbose $(CAMLFLAGS) -o $@ $(CFLAGS) $(FSMCAMLLIBS) $^ $(CLIBS) clean:: rm -f $(DIR)/*.cm[iox] $(DIR)/*.o $(DIR)/*~ Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2012-09-17 14:09:03 UTC (rev 511) +++ trunk/src/mkProjectInfo.ml 2012-09-18 16:10:59 UTC (rev 512) @@ -84,3 +84,4 @@ + From Jerome.Vouillon at pps.jussieu.fr Wed Sep 19 06:30:15 2012 From: Jerome.Vouillon at pps.jussieu.fr (Jerome Vouillon) Date: Wed, 19 Sep 2012 12:30:15 +0200 Subject: [Unison-hackers] [unison-svn] r508 - in trunk: doc src In-Reply-To: References: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> <20120914153442.GA18472@pps.jussieu.fr> Message-ID: <20120919103015.GA7148@pps.jussieu.fr> On Fri, Sep 14, 2012 at 11:45:39AM -0400, Benjamin Pierce wrote: > And then just assume that anybody compiling the beta or developer > versions is going to be using OCaml 4? Yes, that might be a > reasonable compromise. In fact, we should probably make the same change to the beta and developer versions as well. It will take some time before everyone switch to OCaml 4 (in particular, it is still not in Debian)... -- Jerome From vouillon at seas.upenn.edu Wed Sep 19 07:58:57 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Wed, 19 Sep 2012 07:58:57 -0400 Subject: [Unison-hackers] [unison-svn] r513 - in trunk/src: . fsmonitor Message-ID: <201209191158.q8JBww0L007833@yaws.seas.upenn.edu> 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 @@ + From bcpierce at cis.upenn.edu Wed Sep 19 08:50:17 2012 From: bcpierce at cis.upenn.edu (Benjamin C. Pierce) Date: Wed, 19 Sep 2012 08:50:17 -0400 Subject: [Unison-hackers] [unison-svn] r508 - in trunk: doc src In-Reply-To: <20120919103015.GA7148@pps.jussieu.fr> References: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> <20120914153442.GA18472@pps.jussieu.fr> <20120919103015.GA7148@pps.jussieu.fr> Message-ID: On Sep 19, 2012, at 6:30 AM, Jerome Vouillon wrote: > On Fri, Sep 14, 2012 at 11:45:39AM -0400, Benjamin Pierce wrote: >> And then just assume that anybody compiling the beta or developer >> versions is going to be using OCaml 4? Yes, that might be a >> reasonable compromise. > > In fact, we should probably make the same change to the beta and > developer versions as well. It will take some time before everyone > switch to OCaml 4 (in particular, it is still not in Debian)? That effectively means we'll stick with the old hash algorithm forever, I guess. Is that fine, or is the new one a lot better? - B From bcpierce at cis.upenn.edu Wed Sep 19 08:50:42 2012 From: bcpierce at cis.upenn.edu (Benjamin C. Pierce) Date: Wed, 19 Sep 2012 08:50:42 -0400 Subject: [Unison-hackers] [unison-svn] r513 - in trunk/src: . fsmonitor In-Reply-To: <201209191158.q8JBww0L007833@yaws.seas.upenn.edu> References: <201209191158.q8JBww0L007833@yaws.seas.upenn.edu> Message-ID: On Sep 19, 2012, at 7:58 AM, vouillon at seas.upenn.edu wrote: > 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 @@ > > > > + > > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers From Jerome.Vouillon at pps.jussieu.fr Wed Sep 19 13:39:44 2012 From: Jerome.Vouillon at pps.jussieu.fr (Jerome Vouillon) Date: Wed, 19 Sep 2012 19:39:44 +0200 Subject: [Unison-hackers] [unison-svn] r508 - in trunk: doc src In-Reply-To: References: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> <20120914153442.GA18472@pps.jussieu.fr> <20120919103015.GA7148@pps.jussieu.fr> Message-ID: <20120919173944.GC8272@pps.jussieu.fr> On Wed, Sep 19, 2012 at 08:50:17AM -0400, Benjamin C. Pierce wrote: > > On Sep 19, 2012, at 6:30 AM, Jerome Vouillon wrote: > > > On Fri, Sep 14, 2012 at 11:45:39AM -0400, Benjamin Pierce wrote: > >> And then just assume that anybody compiling the beta or developer > >> versions is going to be using OCaml 4? Yes, that might be a > >> reasonable compromise. > > > > In fact, we should probably make the same change to the beta and > > developer versions as well. It will take some time before everyone > > switch to OCaml 4 (in particular, it is still not in Debian)? > > That effectively means we'll stick with the old hash algorithm > forever, I guess. We can change it any time we bump the major version number. And this can be as simple as changing a single function definition. > Is that fine, or is the new one a lot better? The new one is much better, but we do not need a good hash function for comparing archives. Even with a pretty bad hash function, I believe we can detect with a high probability any archive mismatch. -- Jerome From bcpierce at cis.upenn.edu Wed Sep 19 14:21:48 2012 From: bcpierce at cis.upenn.edu (Benjamin Pierce) Date: Wed, 19 Sep 2012 14:21:48 -0400 Subject: [Unison-hackers] [unison-svn] r508 - in trunk: doc src In-Reply-To: <20120919173944.GC8272@pps.jussieu.fr> References: <201209141450.q8EEo7xm024247@yaws.seas.upenn.edu> <20120914153442.GA18472@pps.jussieu.fr> <20120919103015.GA7148@pps.jussieu.fr> <20120919173944.GC8272@pps.jussieu.fr> Message-ID: <6F607B7B-4FAC-470E-B9AA-97D16E7F4BD1@cis.upenn.edu> Ok, I see. Yes, this seems like the way forward... - B On Sep 19, 2012, at 13:39, Jerome Vouillon wrote: > On Wed, Sep 19, 2012 at 08:50:17AM -0400, Benjamin C. Pierce wrote: >> >> On Sep 19, 2012, at 6:30 AM, Jerome Vouillon wrote: >> >>> On Fri, Sep 14, 2012 at 11:45:39AM -0400, Benjamin Pierce wrote: >>>> And then just assume that anybody compiling the beta or developer >>>> versions is going to be using OCaml 4? Yes, that might be a >>>> reasonable compromise. >>> >>> In fact, we should probably make the same change to the beta and >>> developer versions as well. It will take some time before everyone >>> switch to OCaml 4 (in particular, it is still not in Debian)? >> >> That effectively means we'll stick with the old hash algorithm >> forever, I guess. > > We can change it any time we bump the major version number. > And this can be as simple as changing a single function definition. > >> Is that fine, or is the new one a lot better? > > The new one is much better, but we do not need a good hash function > for comparing archives. Even with a pretty bad hash function, I > believe we can detect with a high probability any archive mismatch. > > -- Jerome > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers > From vouillon at seas.upenn.edu Fri Sep 21 08:41:53 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Fri, 21 Sep 2012 08:41:53 -0400 Subject: [Unison-hackers] [unison-svn] r514 - trunk/src Message-ID: <201209211241.q8LCfrKr004450@yaws.seas.upenn.edu> Author: vouillon Date: 2012-09-21 08:41:51 -0400 (Fri, 21 Sep 2012) New Revision: 514 Modified: trunk/src/Makefile.OCaml trunk/src/RECENTNEWS trunk/src/case.ml trunk/src/fspath.ml trunk/src/fspath.mli trunk/src/mkProjectInfo.ml trunk/src/path.ml trunk/src/path.mli trunk/src/props.ml trunk/src/update.ml trunk/src/uutil.ml trunk/src/uutil.mli Log: * Use hash function from OCaml 3.x for comparing archives, even when compiled with OCaml 4.x Modified: trunk/src/Makefile.OCaml =================================================================== --- trunk/src/Makefile.OCaml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/Makefile.OCaml 2012-09-21 12:41:51 UTC (rev 514) @@ -224,7 +224,7 @@ lwt/pqueue.cmo lwt/lwt.cmo lwt/lwt_util.cmo \ lwt/$(SYSTEM)/lwt_unix_impl.cmo lwt/lwt_unix.cmo \ \ - case.cmo pred.cmo uutil.cmo \ + uutil.cmo case.cmo pred.cmo \ fileutil.cmo name.cmo path.cmo fspath.cmo fs.cmo fingerprint.cmo \ abort.cmo osx.cmo external.cmo fswatch.cmo \ props.cmo fileinfo.cmo os.cmo lock.cmo clroot.cmo common.cmo \ Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/RECENTNEWS 2012-09-21 12:41:51 UTC (rev 514) @@ -1,3 +1,9 @@ +CHANGES FROM VERSION 2.46.9 + +* Use hash function from OCaml 3.x for comparing archives, even when + compiled with OCaml 4.x + +------------------------------- CHANGES FROM VERSION 2.46.8 * Filesystem monitoring: do not use filters on maps, for compatibility Modified: trunk/src/case.ml =================================================================== --- trunk/src/case.ml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/case.ml 2012-09-21 12:41:51 UTC (rev 514) @@ -140,7 +140,7 @@ method mode = Sensitive method modeDesc = "case sensitive" method compare s s' = compare (s : string) s' - method hash s = Hashtbl.hash s + method hash s = Uutil.hash s method normalizePattern s = s method caseInsensitiveMatch = false method normalizeMatchedString s = s @@ -152,7 +152,7 @@ method mode = Insensitive method modeDesc = "Latin-1 case insensitive" method compare s s' = Util.nocase_cmp s s' - method hash s = Hashtbl.hash (String.lowercase s) + method hash s = Uutil.hash (String.lowercase s) method normalizePattern s = s method caseInsensitiveMatch = true method normalizeMatchedString s = s @@ -164,7 +164,7 @@ method mode = UnicodeSensitive method modeDesc = "Unicode case sensitive" method compare s s' = Unicode.case_sensitive_compare s s' - method hash s = Hashtbl.hash (Unicode.decompose s) + method hash s = Uutil.hash (Unicode.decompose s) method normalizePattern p = Unicode.decompose p method caseInsensitiveMatch = false method normalizeMatchedString s = Unicode.decompose s @@ -176,7 +176,7 @@ method mode = UnicodeInsensitive method modeDesc = "Unicode case insensitive" method compare s s' = Unicode.case_insensitive_compare s s' - method hash s = Hashtbl.hash (Unicode.normalize s) + method hash s = Uutil.hash (Unicode.normalize s) method normalizePattern p = Unicode.normalize p method caseInsensitiveMatch = false method normalizeMatchedString s = Unicode.normalize s Modified: trunk/src/fspath.ml =================================================================== --- trunk/src/fspath.ml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/fspath.ml 2012-09-21 12:41:51 UTC (rev 514) @@ -335,4 +335,3 @@ let quotes (Fspath f) = Uutil.quotes f let compare (Fspath f1) (Fspath f2) = compare f1 f2 -let hash (Fspath f) = Hashtbl.hash f Modified: trunk/src/fspath.mli =================================================================== --- trunk/src/fspath.mli 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/fspath.mli 2012-09-21 12:41:51 UTC (rev 514) @@ -33,5 +33,3 @@ (* CASE-SENSITIVE comparison between fspaths *) val compare : t -> t -> int -(* CASE-SENSITIVE hash of a fspath *) -val hash : t -> int Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/mkProjectInfo.ml 2012-09-21 12:41:51 UTC (rev 514) @@ -86,3 +86,4 @@ + Modified: trunk/src/path.ml =================================================================== --- trunk/src/path.ml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/path.ml 2012-09-21 12:41:51 UTC (rev 514) @@ -210,10 +210,6 @@ assert (not (isEmpty path)); prefix ^ path -(* No need to perform case normalization on local paths *) -let hash p = Hashtbl.hash p -let equal (p1 : local) (p2 : local) = p1 = p2 - (* Pref controlling whether symlinks are followed. *) let followPred = Pred.create ~advanced:true "follow" ("Including the preference \\texttt{-follow \\ARG{pathspec}} causes Unison to \ Modified: trunk/src/path.mli =================================================================== --- trunk/src/path.mli 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/path.mli 2012-09-21 12:41:51 UTC (rev 514) @@ -33,8 +33,6 @@ (* Add to the final name, but before any file extension. *) val compare : t -> t -> int -val equal : local -> local -> bool -val hash : local -> int val followLink : local -> bool val followPred : Pred.t Modified: trunk/src/props.ml =================================================================== --- trunk/src/props.ml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/props.ml 2012-09-21 12:41:51 UTC (rev 514) @@ -305,7 +305,7 @@ (match id with IdIgnored -> -1 | IdNumeric i -> i - | IdNamed nm -> Hashtbl.hash nm) + | IdNamed nm -> Uutil.hash nm) h let similar id id' = @@ -609,7 +609,7 @@ let dummy = None -let hash t h = Uutil.hash2 (Hashtbl.hash t) h +let hash t h = Uutil.hash2 (Uutil.hash t) h let similar t t' = not (Prefs.read Osx.rsrc) || t = t' Modified: trunk/src/update.ml =================================================================== --- trunk/src/update.ml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/update.ml 2012-09-21 12:41:51 UTC (rev 514) @@ -256,9 +256,9 @@ (checkArchive false (n :: path) a h)) children (Props.hash desc h) | ArchiveFile (desc, dig, _, ress) -> - Uutil.hash2 (Hashtbl.hash dig) (Props.hash desc h) + Uutil.hash2 (Uutil.hash dig) (Props.hash desc h) | ArchiveSymlink content -> - Uutil.hash2 (Hashtbl.hash content) h + Uutil.hash2 (Uutil.hash content) h | NoArchive -> 135 Modified: trunk/src/uutil.ml =================================================================== --- trunk/src/uutil.ml 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/uutil.ml 2012-09-21 12:41:51 UTC (rev 514) @@ -34,6 +34,10 @@ let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF +external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" + +let hash x = hash_param 10 100 x + (*****************************************************************************) (* File sizes *) (*****************************************************************************) Modified: trunk/src/uutil.mli =================================================================== --- trunk/src/uutil.mli 2012-09-19 11:58:57 UTC (rev 513) +++ trunk/src/uutil.mli 2012-09-21 12:41:51 UTC (rev 514) @@ -13,6 +13,8 @@ (* Hashing *) val hash2 : int -> int -> int +(* Hash function (OCaml 3.x version) *) +val hash : 'a -> int module type FILESIZE = sig type t From vouillon at seas.upenn.edu Fri Sep 21 08:42:17 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Fri, 21 Sep 2012 08:42:17 -0400 Subject: [Unison-hackers] [unison-svn] r515 - branches/2.45/src Message-ID: <201209211242.q8LCgHU5004489@yaws.seas.upenn.edu> Author: vouillon Date: 2012-09-21 08:42:17 -0400 (Fri, 21 Sep 2012) New Revision: 515 Modified: branches/2.45/src/Makefile.OCaml branches/2.45/src/RECENTNEWS branches/2.45/src/case.ml branches/2.45/src/fspath.ml branches/2.45/src/fspath.mli branches/2.45/src/mkProjectInfo.ml branches/2.45/src/path.ml branches/2.45/src/path.mli branches/2.45/src/props.ml branches/2.45/src/update.ml branches/2.45/src/uutil.ml branches/2.45/src/uutil.mli Log: * Use hash function from OCaml 3.x for comparing archives, even when compiled with OCaml 4.x Modified: branches/2.45/src/Makefile.OCaml =================================================================== --- branches/2.45/src/Makefile.OCaml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/Makefile.OCaml 2012-09-21 12:42:17 UTC (rev 515) @@ -218,7 +218,7 @@ lwt/pqueue.cmo lwt/lwt.cmo lwt/lwt_util.cmo \ lwt/$(SYSTEM)/lwt_unix_impl.cmo lwt/lwt_unix.cmo \ \ - case.cmo pred.cmo uutil.cmo \ + uutil.cmo case.cmo pred.cmo \ fileutil.cmo name.cmo path.cmo fspath.cmo fs.cmo fingerprint.cmo \ abort.cmo osx.cmo external.cmo \ props.cmo fileinfo.cmo os.cmo lock.cmo clroot.cmo common.cmo \ Modified: branches/2.45/src/RECENTNEWS =================================================================== --- branches/2.45/src/RECENTNEWS 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/RECENTNEWS 2012-09-21 12:42:17 UTC (rev 515) @@ -1,3 +1,9 @@ +CHANGES FROM VERSION 2.45.22 + +* Use hash function from OCaml 3.x for comparing archives, even when + compiled with OCaml 4.x + +------------------------------- CHANGES FROM VERSION 2.45.5 * Add a note to the 'new archives not identical' error message Modified: branches/2.45/src/case.ml =================================================================== --- branches/2.45/src/case.ml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/case.ml 2012-09-21 12:42:17 UTC (rev 515) @@ -140,7 +140,7 @@ method mode = Sensitive method modeDesc = "case sensitive" method compare s s' = compare (s : string) s' - method hash s = Hashtbl.hash s + method hash s = Uutil.hash s method normalizePattern s = s method caseInsensitiveMatch = false method normalizeMatchedString s = s @@ -152,7 +152,7 @@ method mode = Insensitive method modeDesc = "Latin-1 case insensitive" method compare s s' = Util.nocase_cmp s s' - method hash s = Hashtbl.hash (String.lowercase s) + method hash s = Uutil.hash (String.lowercase s) method normalizePattern s = s method caseInsensitiveMatch = true method normalizeMatchedString s = s @@ -164,7 +164,7 @@ method mode = UnicodeSensitive method modeDesc = "Unicode case sensitive" method compare s s' = Unicode.case_sensitive_compare s s' - method hash s = Hashtbl.hash (Unicode.decompose s) + method hash s = Uutil.hash (Unicode.decompose s) method normalizePattern p = Unicode.decompose p method caseInsensitiveMatch = false method normalizeMatchedString s = Unicode.decompose s @@ -176,7 +176,7 @@ method mode = UnicodeInsensitive method modeDesc = "Unicode case insensitive" method compare s s' = Unicode.case_insensitive_compare s s' - method hash s = Hashtbl.hash (Unicode.normalize s) + method hash s = Uutil.hash (Unicode.normalize s) method normalizePattern p = Unicode.normalize p method caseInsensitiveMatch = false method normalizeMatchedString s = Unicode.normalize s Modified: branches/2.45/src/fspath.ml =================================================================== --- branches/2.45/src/fspath.ml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/fspath.ml 2012-09-21 12:42:17 UTC (rev 515) @@ -335,4 +335,3 @@ let quotes (Fspath f) = Uutil.quotes f let compare (Fspath f1) (Fspath f2) = compare f1 f2 -let hash (Fspath f) = Hashtbl.hash f Modified: branches/2.45/src/fspath.mli =================================================================== --- branches/2.45/src/fspath.mli 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/fspath.mli 2012-09-21 12:42:17 UTC (rev 515) @@ -33,5 +33,3 @@ (* CASE-SENSITIVE comparison between fspaths *) val compare : t -> t -> int -(* CASE-SENSITIVE hash of a fspath *) -val hash : t -> int Modified: branches/2.45/src/mkProjectInfo.ml =================================================================== --- branches/2.45/src/mkProjectInfo.ml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/mkProjectInfo.ml 2012-09-21 12:42:17 UTC (rev 515) @@ -69,3 +69,4 @@ + Modified: branches/2.45/src/path.ml =================================================================== --- branches/2.45/src/path.ml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/path.ml 2012-09-21 12:42:17 UTC (rev 515) @@ -202,10 +202,6 @@ assert (not (isEmpty path)); prefix ^ path -(* No need to perform case normalization on local paths *) -let hash p = Hashtbl.hash p -let equal (p1 : local) (p2 : local) = p1 = p2 - (* Pref controlling whether symlinks are followed. *) let followPred = Pred.create ~advanced:true "follow" ("Including the preference \\texttt{-follow \\ARG{pathspec}} causes Unison to \ Modified: branches/2.45/src/path.mli =================================================================== --- branches/2.45/src/path.mli 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/path.mli 2012-09-21 12:42:17 UTC (rev 515) @@ -31,8 +31,6 @@ val addPrefixToFinalName : local -> string -> local val compare : t -> t -> int -val equal : local -> local -> bool -val hash : local -> int val followLink : local -> bool val followPred : Pred.t Modified: branches/2.45/src/props.ml =================================================================== --- branches/2.45/src/props.ml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/props.ml 2012-09-21 12:42:17 UTC (rev 515) @@ -305,7 +305,7 @@ (match id with IdIgnored -> -1 | IdNumeric i -> i - | IdNamed nm -> Hashtbl.hash nm) + | IdNamed nm -> Uutil.hash nm) h let similar id id' = @@ -609,7 +609,7 @@ let dummy = None -let hash t h = Uutil.hash2 (Hashtbl.hash t) h +let hash t h = Uutil.hash2 (Uutil.hash t) h let similar t t' = not (Prefs.read Osx.rsrc) || t = t' Modified: branches/2.45/src/update.ml =================================================================== --- branches/2.45/src/update.ml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/update.ml 2012-09-21 12:42:17 UTC (rev 515) @@ -256,9 +256,9 @@ (checkArchive false (n :: path) a h)) children (Props.hash desc h) | ArchiveFile (desc, dig, _, ress) -> - Uutil.hash2 (Hashtbl.hash dig) (Props.hash desc h) + Uutil.hash2 (Uutil.hash dig) (Props.hash desc h) | ArchiveSymlink content -> - Uutil.hash2 (Hashtbl.hash content) h + Uutil.hash2 (Uutil.hash content) h | NoArchive -> 135 Modified: branches/2.45/src/uutil.ml =================================================================== --- branches/2.45/src/uutil.ml 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/uutil.ml 2012-09-21 12:42:17 UTC (rev 515) @@ -34,6 +34,10 @@ let hash2 x y = (17 * x + 257 * y) land 0x3FFFFFFF +external hash_param : int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" + +let hash x = hash_param 10 100 x + (*****************************************************************************) (* File sizes *) (*****************************************************************************) Modified: branches/2.45/src/uutil.mli =================================================================== --- branches/2.45/src/uutil.mli 2012-09-21 12:41:51 UTC (rev 514) +++ branches/2.45/src/uutil.mli 2012-09-21 12:42:17 UTC (rev 515) @@ -13,6 +13,8 @@ (* Hashing *) val hash2 : int -> int -> int +(* Hash function (OCaml 3.x version) *) +val hash : 'a -> int module type FILESIZE = sig type t From vouillon at seas.upenn.edu Mon Sep 24 07:44:38 2012 From: vouillon at seas.upenn.edu (vouillon at seas.upenn.edu) Date: Mon, 24 Sep 2012 07:44:38 -0400 Subject: [Unison-hackers] [unison-svn] r516 - in trunk/src: . fsmonitor Message-ID: <201209241144.q8OBidEN026267@yaws.seas.upenn.edu> Author: vouillon Date: 2012-09-24 07:44:38 -0400 (Mon, 24 Sep 2012) New Revision: 516 Modified: trunk/src/RECENTNEWS trunk/src/fsmonitor/watchercommon.ml trunk/src/fswatch.ml trunk/src/mkProjectInfo.ml Log: * File system monitoring: more robust communication with the helper program (in socket mode, the unison server will still work properly despite unexpected unison client disconnections) Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2012-09-21 12:42:17 UTC (rev 515) +++ trunk/src/RECENTNEWS 2012-09-24 11:44:38 UTC (rev 516) @@ -1,3 +1,10 @@ +CHANGES FROM VERSION 2.46.10 + +* File system monitoring: more robust communication with the helper program + (in socket mode, the unison server will still work properly despite + unexpected unison client disconnections) + +------------------------------- CHANGES FROM VERSION 2.46.9 * Use hash function from OCaml 3.x for comparing archives, even when Modified: trunk/src/fsmonitor/watchercommon.ml =================================================================== --- trunk/src/fsmonitor/watchercommon.ml 2012-09-21 12:42:17 UTC (rev 515) +++ trunk/src/fsmonitor/watchercommon.ml 2012-09-24 11:44:38 UTC (rev 516) @@ -360,7 +360,8 @@ let signal_overflow () = Hashtbl.iter (fun _ r -> r.changed <- true) roots; - ignore (signal_changes !waiting_for_changes) + if not (StringSet.is_empty !waiting_for_changes) then + ignore (signal_changes !waiting_for_changes) (****) Modified: trunk/src/fswatch.ml =================================================================== --- trunk/src/fswatch.ml 2012-09-21 12:42:17 UTC (rev 515) +++ trunk/src/fswatch.ml 2012-09-24 11:44:38 UTC (rev 516) @@ -74,10 +74,6 @@ Finally, the command 'RESET hash' tells the child process to stop watching the given replica. In particular, it can discard any pending change information for this replica. - - UNISON CLIENT-SERVER PROTOCOL CHANGE! - - - =====> fix [associate] function <================ *) let debug = Util.debug "fswatch" @@ -271,25 +267,42 @@ ("unison-fsmonitor" ^ suffix))) type 'a exn_option = Value of 'a | Exn of exn | Nothing -let has_changes = Cond.make () -let has_line = Cond.make () -let line_read = Cond.make () -let last_line = ref Nothing -let rec reader read_line = +type conn = + { output : Lwt_unix.file_descr; + has_changes : Cond.t; + has_line : Cond.t; + line_read : Cond.t; + mutable last_line : string exn_option } + +let conn = ref None + +let rec reader conn read_line = read_line () >>= fun l -> - Cond.signal has_changes; - if l = "CHANGES" then begin - reader read_line + Cond.signal conn.has_changes; + if fst (split_on_space l) = "CHANGES" then begin + reader conn read_line end else begin - last_line := Value l; - Cond.signal has_line; - Cond.wait line_read >>= fun () -> - reader read_line + conn.last_line <- Value l; + Cond.signal conn.has_line; + Cond.wait conn.line_read >>= fun () -> + reader conn read_line end -let conn = ref None +let safeClose fd = try Lwt_unix.close fd with Unix.Unix_error _ -> () +let currentConnection () = + match !conn with + Some c -> c + | None -> raise (Util.Fatal ("File monitoring helper program not running")) + +let closeConnection () = + match !conn with + Some c -> conn := None; safeClose c.output + | None -> () + +let connected () = !conn <> None + let startProcess () = try let w = Lazy.force watcher in @@ -300,29 +313,42 @@ Util.convertUnixErrorsToFatal "starting filesystem watcher" (fun () -> ignore (System.create_process w [|w|] i1 o2 Unix.stderr)); Unix.close i1; Unix.close o2; + let c = + { output = o1; + has_changes = Cond.make (); + has_line = Cond.make (); + line_read = Cond.make (); + last_line = Nothing } + in ignore - (Lwt.catch (fun () -> reader (read_line i2)) + (Lwt.catch (fun () -> reader c (read_line i2)) (fun e -> - Cond.signal has_changes; - last_line := Exn e; Cond.signal has_line; Lwt.return ())); - conn := Some o1; + closeConnection (); safeClose i2; + Cond.signal c.has_changes; + c.last_line <- Exn e; Cond.signal c.has_line; + Lwt.return ())); + conn := Some c; true with Not_found -> false -let rec emitCmd fmt = - match !conn with - Some o -> begin try printf o fmt with e -> conn := None; raise e end - | None -> assert false - +let emitCmd fmt = + let c = currentConnection () in + try + printf c.output fmt + with e -> + closeConnection (); + raise e + let rec readLine () = - match !last_line with - Nothing -> Lwt_unix.run (Cond.wait has_line); readLine () - | Value l -> last_line := Nothing; Cond.signal line_read; l - | Exn e -> conn := None; raise e + let c = currentConnection () in + match c.last_line with + Nothing -> Lwt_unix.run (Cond.wait c.has_line); readLine () + | Value l -> c.last_line <- Nothing; Cond.signal c.line_read; l + | Exn e -> raise e let badResponse cmd args expected = - conn := None; + closeConnection (); if cmd = "ERROR" then raise (Util.Fatal ("Filesystem watcher error: " ^ (unquote args) ^ "\n\ The watcher can be disabled by setting preference \ @@ -373,10 +399,8 @@ String.sub s2 (l1 + 1) (l2 - l1 - 1) end -let started () = !conn <> None - let startScanning hash fspath path = - if started () then begin + if connected () then begin emitCmd "START %s %s %s\n" (quote hash) (quote (Fspath.toString fspath)) (quote (Path.toString path)); @@ -406,7 +430,7 @@ let start hash = if not (Prefs.read useWatcher) then false - else if not (started ()) then + else if not (connected ()) then exchangeVersions () else begin emitCmd "RESET %s\n" (quote hash); @@ -414,12 +438,10 @@ end let wait hash = - if started () then begin - let res = Cond.wait has_changes in - emitCmd "WAIT %s\n" (quote hash); - res - end else - raise (Util.Fatal "No file monitoring helper program found") + let c = currentConnection () in + let res = Cond.wait c.has_changes in + emitCmd "WAIT %s\n" (quote hash); + res (****) @@ -436,7 +458,7 @@ badResponse other args "RECURSIVE or DONE" let getChanges hash = - if started () then begin + if connected () then begin emitCmd "CHANGES %s\n" (quote hash); parseChanges [] end else Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2012-09-21 12:42:17 UTC (rev 515) +++ trunk/src/mkProjectInfo.ml 2012-09-24 11:44:38 UTC (rev 516) @@ -87,3 +87,4 @@ +