[Unison-hackers] More patches for 2.12.0

Jerome Vouillon Jerome.Vouillon at pps.jussieu.fr
Fri May 27 17:43:16 EDT 2005


These are patches specific to Unison 2.12.0

-- Jerome
-------------- next part --------------
Disable password prompting code (broken in 2.12.0)
diff -ur unison-2.12.0.orig/uigtk2.ml unison-2.12.0/uigtk2.ml
--- unison-2.12.0.orig/uigtk2.ml	2005-03-12 17:17:59.000000000 +0100
+++ unison-2.12.0/uigtk2.ml	2005-05-27 15:53:19.411134541 +0200
@@ -745,8 +745,7 @@
     match Uicommon.sshParse s with
       Uicommon.Password account -> getPassword account
     | _ -> "" in
-  if Osx.isMacOSX or Osx.isLinux then Some handleSSH
-  else None
+  None
 
 (* ------ *)
 
-------------- next part --------------
Fix in property setting.  In particular, set properties in the right order.
diff -ur unison-2.12.0.orig/props.ml unison-2.12.0/props.ml
--- unison-2.12.0.orig/props.ml	2005-03-12 17:17:59.000000000 +0100
+++ unison-2.12.0/props.ml	2005-05-27 15:53:09.545933728 +0200
@@ -421,7 +421,7 @@
 
 let iCanWrite p =
   try
-    Unix.access p [Unix.R_OK];
+    Unix.access p [Unix.W_OK];
     true
   with
     Unix.Unix_error _ -> false
@@ -625,8 +625,8 @@
   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
+  Time.set fspath path kind p.time;
+  Perm.set fspath path kind p.perm
 
 let init someHostIsRunningWindows =
   Perm.init someHostIsRunningWindows;
-------------- next part --------------
Fix substitution of CURRENT1 and CURRENT2 in diff command.
Index: src/files.ml
===================================================================
--- src/files.ml        (revision 28)
+++ src/files.ml        (revision 29)
@@ -429,8 +435,8 @@
      ^ "utility used to generate displays of file differences.  The default "
      ^ "is `\\verb|diff|'.  If the value of this preference contains the substrings "
      ^ "CURRENT1 and CURRENT2, these will be replaced by the names of the files to be "
-     ^ "diffed.  If not, the two filenames will be appended to the command (enclosed "
-     ^ "in double quotes).")
+     ^ "diffed.  If not, the two filenames will be appended to the command.  In both "
+     ^ "cases, the filenames are suitably quoted.")
 
 let quotes s = "'" ^ Util.replacesubstring s "'" "'\''" ^ "'"
 
@@ -442,14 +448,14 @@
       (root2string root2) (Path.toString path2));
   let displayDiff fspath1 fspath2 =
     let cmd =
-      if Util.findsubstring (Prefs.read diffCmd) "CURRENT1" = None then
+      if Util.findsubstring "CURRENT1" (Prefs.read diffCmd) = None then
           (Prefs.read diffCmd)
         ^ " " ^ (quotes (Fspath.toString fspath1))
-        ^ " " ^ (quotes (Fspath.toString fspath2)) 
-      else 
+        ^ " " ^ (quotes (Fspath.toString fspath2))
+      else
         Util.replacesubstrings (Prefs.read diffCmd)
-          ["CURRENT1", (Fspath.toString fspath1);
-           "CURRENT2", (Fspath.toString fspath2)] in
+          ["CURRENT1", quotes (Fspath.toString fspath1);
+           "CURRENT2", quotes (Fspath.toString fspath2)] in
     let c = Unix.open_process_in cmd in
     showDiff cmd (readChannelTillEof c);
     ignore(Unix.close_process_in c) in


More information about the Unison-hackers mailing list