[Unison-hackers] patches for 2.10.2 and 2.12.0

Zvezdan Petkovic zpetkovic at acm.org
Sun May 22 17:51:13 EDT 2005


On Sun, May 22, 2005 at 06:10:03PM +0100, Max Bowsher wrote:
> You're welcome - and I probably ought to be showing what I've changed 
> anyway. I had been intending to, which is why I gave the patches names in 
> the IMPORTANT.html file. So, I've now uploaded the patches.
> 
> https://cvs.cis.upenn.edu:3690/svnroot/unison-contributed-binaries/patches/

Thanks a lot Max.
Now, the only issue I have is that I've found more patches on the list
than these four.
I've attached all the patches that are currently in my port.

Jerome, can you please confirm that _all_ of them should go in?

Max, if Jerome's answer is yes, you might want to add some of these.

These are patches for the stable version 2.10.2.
I'm sending the patches for beta in the next message.

	Zvezdan
-------------- next part --------------
$OpenBSD$
Post-release developer patch.
Fix the Windows client hang problem.
--- copy.ml.orig	Mon Sep  6 15:15:47 2004
+++ copy.ml	Sun May 22 16:14:14 2005
@@ -1,5 +1,5 @@
 (* $I1: Unison file synchronizer: src/copy.ml $ *)
-(* $I2: Last modified by vouillon on Wed, 01 Sep 2004 07:35:22 -0400 $ *)
+(* $I2: Last modified by vouillon on Thu, 09 Sep 2004 08:43:03 -0400 $ *)
 (* $I3: Copyright 1999-2004 (see COPYING for details) $ *)
 
 let (>>=) = Lwt.bind
@@ -260,10 +260,9 @@ let reallyTransmitFile
     fspathTo pathTo realPathTo `DATA update srcFileSize id file_id
     >>= (fun (outfd, infd, bi) ->
   Lwt.catch (fun () ->
-    Lwt_util.run_in_region transmitFileReg (bufferSize srcFileSize) (fun () ->
-      Uutil.showProgress id Uutil.Filesize.zero "f";
-      compressRemotely connFrom
-        (bi, fspathFrom, pathFrom, `DATA, srcFileSize, id, file_id))
+    Uutil.showProgress id Uutil.Filesize.zero "f";
+    compressRemotely connFrom
+      (bi, fspathFrom, pathFrom, `DATA, srcFileSize, id, file_id)
             >>= (fun () ->
     decompressor :=
       Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
@@ -281,16 +280,15 @@ let reallyTransmitFile
       (`RESS ressLength) update ressLength id file_id
         >>= (fun (outfd, infd, bi) ->
     Lwt.catch (fun () ->
-      Lwt_util.run_in_region transmitFileReg (bufferSize ressLength) (fun () ->
-        Uutil.showProgress id Uutil.Filesize.zero "f";
-        compressRemotely connFrom
-          (bi, fspathFrom, pathFrom,
-           `RESS ressLength, ressLength, id, file_id))
-              >>= (fun () ->
-        decompressor :=
-          Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
-        close_all infd outfd;
-        Lwt.return ()))
+      Uutil.showProgress id Uutil.Filesize.zero "f";
+      compressRemotely connFrom
+        (bi, fspathFrom, pathFrom,
+         `RESS ressLength, ressLength, id, file_id)
+            >>= (fun () ->
+      decompressor :=
+        Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
+      close_all infd outfd;
+      Lwt.return ()))
     (fun e ->
        decompressor :=
          Remote.MsgIdMap.remove file_id !decompressor; (* For GC *)
@@ -367,9 +365,13 @@ let transmitFileOnRoot =
 let transmitFile
     rootFrom pathFrom rootTo fspathTo pathTo realPathTo
     update desc fp ress id =
-  transmitFileOnRoot rootTo rootFrom
-    (snd rootFrom, pathFrom, fspathTo, pathTo, realPathTo,
-     update, desc, fp, ress, id)
+  let bufSz = bufferSize (max (Props.length desc) (Osx.ressLength ress)) in
+  (* This must be on the client: any lock on the server side may result
+     in a deadlock under windows *)
+  Lwt_util.run_in_region transmitFileReg bufSz (fun () ->
+    transmitFileOnRoot rootTo rootFrom
+      (snd rootFrom, pathFrom, fspathTo, pathTo, realPathTo,
+       update, desc, fp, ress, id))
 
 (****)
 
-------------- next part --------------
$OpenBSD$
Post-release developer patch.
Fix the problem with comparison of files using diff
when the files are on two different hosts.
--- files.ml.orig	Mon Sep  6 15:15:46 2004
+++ files.ml	Sun May 22 16:13:36 2005
@@ -469,8 +469,8 @@ let rec diff root1 path1 ui1 root2 path2
            Lwt_unix.run
              (Update.translatePath root2 path2 >>= (fun path2 ->
               Copy.file root2 path2 root1 workingDir tmppath realPath
-                `Copy (Props.setLength Props.fileSafe (Props.length desc1))
-                 fp1 ress1 id));
+                `Copy (Props.setLength Props.fileSafe (Props.length desc2))
+                 fp2 ress2 id));
            displayDiff
 	     (Fspath.concat workingDir realPath)
              (Fspath.concat workingDir tmppath);
@@ -487,8 +487,8 @@ let rec diff root1 path1 ui1 root2 path2
              (Update.translatePath root1 path1 >>= (fun path1 ->
               (* Note that we don't need the ressource fork *)
               Copy.file root1 path1 root2 workingDir tmppath realPath
-                `Copy (Props.setLength Props.fileSafe (Props.length desc2))
-                 fp2 ress2 id));
+                `Copy (Props.setLength Props.fileSafe (Props.length desc1))
+                 fp1 ress1 id));
            displayDiff
              (Fspath.concat workingDir tmppath)
 	     (Fspath.concat workingDir realPath);
-------------- next part --------------
$OpenBSD$
Post-release developer patch.
Fix the unison failure when the directory is read-only.
--- os.ml.orig	Mon Sep  6 15:15:46 2004
+++ os.ml	Sun May 22 16:16:28 2005
@@ -167,7 +167,9 @@ and delete fspath path =
        let absolutePath = Fspath.concatToString fspath path in
        match (Fileinfo.get false fspath path).Fileinfo.typ with
          `DIRECTORY ->
-           Unix.chmod absolutePath 0o700;
+           begin try
+             Unix.chmod absolutePath 0o700
+           with Unix.Unix_error _ -> () end;
            Safelist.iter
              (fun child -> delete fspath (Path.child path child))
              (childrenOf fspath path);
-------------- next part --------------
$OpenBSD$
Post-release developer patch.
Fix the Mac OS X client problem.
--- props.ml.orig	Mon Sep  6 15:15:46 2004
+++ props.ml	Sun May 22 16:19:19 2005
@@ -615,9 +615,9 @@ let get stats infos =
 let set fspath path kind p =
   Uid.set fspath path kind p.uid;
   Gid.set fspath path kind p.gid;
+  TypeCreator.set fspath path kind p.typeCreator;
   Perm.set fspath path kind p.perm;
-  Time.set fspath path kind p.time;
-  TypeCreator.set fspath path kind p.typeCreator
+  Time.set fspath path kind p.time
 
 let init someHostIsRunningWindows =
   Perm.init someHostIsRunningWindows;
-------------- next part --------------
$OpenBSD$
Post-release developer patch.
Fix the assert failure on all platforms.
--- transport.ml.orig	Mon Sep  6 15:15:46 2004
+++ transport.ml	Sun May 22 16:14:32 2005
@@ -15,7 +15,8 @@ let fileSize uiFrom uiTo =
   match uiFrom, uiTo with
     _, Updates (File (props, ContentsUpdated (_, _, ress)), _) ->
       (Props.length props, Osx.ressLength ress)
-  | Updates (File _, Previous (_, props, _, ress)), NoUpdates ->
+  | Updates (_, Previous (`FILE, props, _, ress)),
+    (NoUpdates | Updates (File (_, ContentsSame), _)) ->
       (Props.length props, Osx.ressLength ress)
   | _ ->
       assert false
-------------- next part --------------
$OpenBSD$
Fix compilation with GTK 1 on OpenBSD.
Applied the same approach used in beta version by developers.
	Zvezdan Petkovic
--- uigtk.ml.orig	Mon Sep  6 15:15:46 2004
+++ uigtk.ml	Tue May 17 02:21:59 2005
@@ -1606,7 +1606,7 @@ in
                   catch (fun () ->
                            Transport.transportItem
                              theSI.ri (Uutil.File.ofLine i)
-                             (fun title text -> Trace.status (Printf.sprintf "\n%s\n\n%s\n\n" title text))
+                             (fun title text -> Trace.status (Printf.sprintf "\n%s\n\n%s\n\n" title text); true)
                            >>= (fun () ->
                            return Util.Succeeded))
                         (fun e ->
@@ -1760,6 +1760,7 @@ in
   actionBar#insert_space ();
   grAdd grDiff (actionBar#insert_button ~text:"Diff" ~callback:diffCmd ());
 
+(*
   let mergeCmd () =
     match !current with
       Some i ->
@@ -1787,7 +1788,7 @@ in
 
   actionBar#insert_space ();
   grAdd grDiff (actionBar#insert_button ~text:"Merge" ~callback:mergeCmd ());
-
+*)
   (*********************************************************************
     Keyboard commands
    *********************************************************************)
-------------- next part --------------
$OpenBSD$
Post-release developer patch.
Update archive timestamps to avoid defeating fastcheck on Windows.
--- update.ml.orig	Mon Sep  6 15:15:46 2004
+++ update.ml	Sun May 22 16:19:54 2005
@@ -1625,7 +1625,7 @@ let rec buildUpdate archive fspath fullp
              Note that we may also put NoArchive deep inside an
              archive...
           *)
-          (ArchiveDir (desc, NameMap.add name' child otherChildren),
+          (ArchiveDir (desc, NameMap.add name' arch otherChildren),
            updates)
 
 (* for the given path, find the archive and compute the list of update


More information about the Unison-hackers mailing list