[Unison-hackers] [unison-svn] r338 - branches/2.32/src

vouillon@seas.upenn.edu vouillon at seas.upenn.edu
Tue May 26 05:42:44 EDT 2009


Author: vouillon
Date: 2009-05-26 05:42:42 -0400 (Tue, 26 May 2009)
New Revision: 338

Modified:
   branches/2.32/src/RECENTNEWS
   branches/2.32/src/copy.ml
   branches/2.32/src/fileinfo.ml
   branches/2.32/src/mkProjectInfo.ml
   branches/2.32/src/osx.ml
Log:
* Added some missing convertUnixErrorsToTransient


Modified: branches/2.32/src/RECENTNEWS
===================================================================
--- branches/2.32/src/RECENTNEWS	2009-05-26 09:38:19 UTC (rev 337)
+++ branches/2.32/src/RECENTNEWS	2009-05-26 09:42:42 UTC (rev 338)
@@ -1,3 +1,8 @@
+CHANGES FROM VERSION 2.32.23
+
+* Added some missing convertUnixErrorsToTransient
+
+-------------------------------
 CHANGES FROM VERSION 2.32.19
 
 * Small documentation fix suggested by mszsummer.

Modified: branches/2.32/src/copy.ml
===================================================================
--- branches/2.32/src/copy.ml	2009-05-26 09:38:19 UTC (rev 337)
+++ branches/2.32/src/copy.ml	2009-05-26 09:42:42 UTC (rev 338)
@@ -562,25 +562,23 @@
   Remote.registerRootCmdWithConnection "setFileinfo" setFileinfoLocal
 
 let targetExists checkSize fspathTo pathTo =
-     Os.exists fspathTo pathTo
+  let info = Fileinfo.get false fspathTo pathTo in
+  info.Fileinfo.typ = `FILE
   && (match checkSize with
         `MakeWriteableAndCheckNonempty ->
-          let n = Fspath.concatToString fspathTo pathTo in
-          let perms = (Unix.stat n).Unix.st_perm in
+          let perms = Props.perms info.Fileinfo.desc in
           let perms' = perms lor 0o600 in
-          Unix.chmod n perms';
-          let r =
-            Props.length (Fileinfo.get false fspathTo pathTo).Fileinfo.desc
-              > Uutil.Filesize.zero in
-          r
+          Util.convertUnixErrorsToTransient
+            "making target writable"
+            (fun () ->
+               Unix.chmod (Fspath.concatToString fspathTo pathTo) perms');
+          Props.length info.Fileinfo.desc > Uutil.Filesize.zero
       | `CheckDataSize desc ->
-             Props.length (Fileinfo.get false fspathTo pathTo).Fileinfo.desc
-               = Props.length desc
+             Props.length info.Fileinfo.desc = Props.length desc
       | `CheckSize (desc,ress) ->
-             Props.length (Fileinfo.get false fspathTo pathTo).Fileinfo.desc
-               = Props.length desc
-          && Osx.ressLength (Osx.getFileInfos fspathTo pathTo `FILE).Osx.ressInfo
-               = Osx.ressLength ress)
+             Props.length info.Fileinfo.desc = Props.length desc
+          && Osx.ressLength info.Fileinfo.osX.Osx.ressInfo =
+             Osx.ressLength ress)
 
 let targetExistsLocal connFrom (checkSize, fspathTo, pathTo) =
   Lwt.return (targetExists checkSize fspathTo pathTo)

Modified: branches/2.32/src/fileinfo.ml
===================================================================
--- branches/2.32/src/fileinfo.ml	2009-05-26 09:38:19 UTC (rev 337)
+++ branches/2.32/src/fileinfo.ml	2009-05-26 09:42:42 UTC (rev 338)
@@ -82,7 +82,9 @@
            osX      = Osx.getFileInfos fspath path `ABSENT })
 
 let check fspath path props =
-  Props.check fspath path (statFn false fspath path) props
+  Util.convertUnixErrorsToTransient
+  "checking file information"
+    (fun () -> Props.check fspath path (statFn false fspath path) props)
 
 let set fspath path action newDesc =
   let (kind, p) =

Modified: branches/2.32/src/mkProjectInfo.ml
===================================================================
--- branches/2.32/src/mkProjectInfo.ml	2009-05-26 09:38:19 UTC (rev 337)
+++ branches/2.32/src/mkProjectInfo.ml	2009-05-26 09:42:42 UTC (rev 338)
@@ -110,3 +110,4 @@
 
 
 
+

Modified: branches/2.32/src/osx.ml
===================================================================
--- branches/2.32/src/osx.ml	2009-05-26 09:38:19 UTC (rev 337)
+++ branches/2.32/src/osx.ml	2009-05-26 09:42:42 UTC (rev 338)
@@ -242,7 +242,9 @@
                   "")
                 (fun () -> close_in_noerr inch)
             in
-            let stats = Unix.LargeFile.stat doublePath in
+            let stats =
+              Util.convertUnixErrorsToTransient "stating AppleDouble file"
+                (fun () -> Unix.LargeFile.stat doublePath) in
             { ressInfo =
                 if rsrcLength = 0L then NoRess else
                 AppleDoubleRess



More information about the Unison-hackers mailing list