[Unison-hackers] [unison-svn] r511 - branches/2.40/src

Benjamin C. Pierce bcpierce at cis.upenn.edu
Mon Sep 17 10:30:02 EDT 2012


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



More information about the Unison-hackers mailing list