[Unison-hackers] [unison-svn] r389 - in trunk: doc src src/lwt src/uimacnew src/uimacnew/English.lproj/MainMenu.nib src/uimacnew/uimacnew.xcodeproj

bcpierce@seas.upenn.edu bcpierce at seas.upenn.edu
Sun Nov 29 08:56:09 EST 2009


Author: bcpierce
Date: 2009-11-29 08:56:09 -0500 (Sun, 29 Nov 2009)
New Revision: 389

Modified:
   trunk/doc/unison-manual.tex
   trunk/src/RECENTNEWS
   trunk/src/TODO.txt
   trunk/src/lwt/depend
   trunk/src/mkProjectInfo.ml
   trunk/src/props.ml
   trunk/src/uimacnew/English.lproj/MainMenu.nib/info.nib
   trunk/src/uimacnew/English.lproj/MainMenu.nib/keyedobjects.nib
   trunk/src/uimacnew/MyController.m
   trunk/src/uimacnew/ProgressCell.m
   trunk/src/uimacnew/uimacnew.xcodeproj/project.pbxproj
   trunk/src/update.ml
Log:
* Small doc tweak in tutorial

* Add preference to ignore existing archives (to avoid forcing users
  to delete them manually, in situations where one archive has gotten
  deleted or corrupted).

* Small patch to property setting code suggested by Ulrich Gernkow.

* Apply patch to fix some crashes in the OSX GUI, thanks to Onne Gorter.



Modified: trunk/doc/unison-manual.tex
===================================================================
--- trunk/doc/unison-manual.tex	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/doc/unison-manual.tex	2009-11-29 13:56:09 UTC (rev 389)
@@ -439,6 +439,7 @@
 \begin{verbatim}
        unison a.tmp b.tmp
 \end{verbatim}
+(You may need to add \verb|-ui text|, depending how your unison binary was built.)
 
 \begin{textui}
 You should see a message notifying you that all the files are actually

Modified: trunk/src/RECENTNEWS
===================================================================
--- trunk/src/RECENTNEWS	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/RECENTNEWS	2009-11-29 13:56:09 UTC (rev 389)
@@ -1,3 +1,17 @@
+CHANGES FROM VERSION 2.38.0
+
+* Small doc tweak in tutorial
+
+* Add preference to ignore existing archives (to avoid forcing users
+  to delete them manually, in situations where one archive has gotten
+  deleted or corrupted).
+
+* Small patch to property setting code suggested by Ulrich Gernkow.
+
+* Apply patch to fix some crashes in the OSX GUI, thanks to Onne Gorter.
+
+
+-------------------------------
 CHANGES FROM VERSION 2.37.11
 
 * Fixed incompatible protocol change introduced in last commit

Modified: trunk/src/TODO.txt
===================================================================
--- trunk/src/TODO.txt	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/TODO.txt	2009-11-29 13:56:09 UTC (rev 389)
@@ -102,11 +102,17 @@
 
 *** See if we can get rid of some Osx.XXX stuff (e.g. ressLength!?)
 
+*** Overlapping paths
+    If one -path argument is a prefix of another, the same files will get
+    scanned twice, found to need transferring twice, and transferred twice, but
+    the first transfer messes up the second.  The fix would be to throw
+    away -path arguments that are suffixes of other ones.
+
 *** Add the following to the Problems FAQ:
 
-  --- In unison-hackers at y..., "Matt Swift" <swift at a...> wrote:
-  > I just posted a msg to cygwin at c... detailing some very strange 
-  > behavior of chmod when a file's owner is also the file's group.  It 
+  --- In unison-hackers at y..., "Matt Swift" <swift at a...> wrote: > I just
+  posted a msg to cygwin at c... detailing some very strange > behavior of
+  chmod when a file's owner is also the file's group.  It
 
   I was right about the crucial circumstances of owner = group.  Moral:
   do not let user=group under Cygwin.  I know it causes a problem when

Modified: trunk/src/lwt/depend
===================================================================
--- trunk/src/lwt/depend	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/lwt/depend	2009-11-29 13:56:09 UTC (rev 389)
@@ -6,5 +6,7 @@
 lwt_util.cmx: lwt.cmx lwt_util.cmi 
 pqueue.cmo: pqueue.cmi 
 pqueue.cmx: pqueue.cmi 
+lwt.cmi: 
 lwt_unix.cmi: lwt.cmi 
 lwt_util.cmi: lwt.cmi 
+pqueue.cmi: 

Modified: trunk/src/mkProjectInfo.ml
===================================================================
--- trunk/src/mkProjectInfo.ml	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/mkProjectInfo.ml	2009-11-29 13:56:09 UTC (rev 389)
@@ -5,8 +5,8 @@
 
 let projectName = "unison"
 let majorVersion = 2
-let minorVersion = 37
-let pointVersionOrigin = 377 (* Revision that corresponds to point version 0 *)
+let minorVersion = 38
+let pointVersionOrigin = 388 (* Revision that corresponds to point version 0 *)
 
 (* Documentation:
    This is a program to construct a version of the form Major.Minor.Point,
@@ -87,3 +87,4 @@
 Printf.printf "VERSION=%d.%d.%d\n" majorVersion minorVersion pointVersion;;
 Printf.printf "NAME=%s\n" projectName;;
 
+

Modified: trunk/src/props.ml
===================================================================
--- trunk/src/props.ml	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/props.ml	2009-11-29 13:56:09 UTC (rev 389)
@@ -215,7 +215,7 @@
 
 let check fspath path stats (fp, mask) =
   let fp' = stats.Unix.LargeFile.st_perm in
-  if fp land mask <> fp' land mask then
+  if (not (Prefs.read dontChmod)) && (fp land mask <> fp' land mask) then
     raise
       (Util.Transient
          (Format.sprintf

Modified: trunk/src/uimacnew/English.lproj/MainMenu.nib/info.nib
===================================================================
--- trunk/src/uimacnew/English.lproj/MainMenu.nib/info.nib	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/uimacnew/English.lproj/MainMenu.nib/info.nib	2009-11-29 13:56:09 UTC (rev 389)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>IBFramework Version</key>
-	<string>670</string>
+	<string>677</string>
 	<key>IBLastKnownRelativeProjectPath</key>
 	<string>../uimacnew.xcodeproj</string>
 	<key>IBOldestOS</key>
@@ -11,15 +11,15 @@
 	<key>IBOpenObjects</key>
 	<array>
 		<integer>402</integer>
-		<integer>198</integer>
 		<integer>423</integer>
 		<integer>29</integer>
+		<integer>21</integer>
+		<integer>307</integer>
 		<integer>197</integer>
-		<integer>307</integer>
-		<integer>21</integer>
+		<integer>198</integer>
 	</array>
 	<key>IBSystem Version</key>
-	<string>9E17</string>
+	<string>9L30</string>
 	<key>targetFramework</key>
 	<string>IBCocoaFramework</string>
 </dict>

Modified: trunk/src/uimacnew/English.lproj/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: trunk/src/uimacnew/MyController.m
===================================================================
--- trunk/src/uimacnew/MyController.m	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/uimacnew/MyController.m	2009-11-29 13:56:09 UTC (rev 389)
@@ -29,6 +29,10 @@
 static int dontAsk = 1;
 static int doAsk = 2;
 
+// BCP (11/09): Added per Onne Gorter:
+// if user closes main window, terminate app, instead of keeping an empty app around with no window
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { return YES; }
+
 - (id)init
 {
     if (([super init])) {

Modified: trunk/src/uimacnew/ProgressCell.m
===================================================================
--- trunk/src/uimacnew/ProgressCell.m	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/uimacnew/ProgressCell.m	2009-11-29 13:56:09 UTC (rev 389)
@@ -62,23 +62,30 @@
 	return self;
 }
 
-- (void)dealloc
-{
-	[_icon release];
-	[_statusString release];
-	[super dealloc];
-}
+// BCP: Removed (11/09) per Onne Gorter
+// - (void)dealloc
+// {
+// 	[_icon release];
+// 	[_statusString release];
+// 	[super dealloc];
+// }
 
 - (void)setStatusString:(NSString *)string
 {
-	[_statusString autorelease];
-	_statusString = [string retain];
+  // BCP: Removed (11/09) per Onne Gorter
+  //	[_statusString autorelease];
+  //	_statusString = [string retain];
+  // Added:
+	_statusString = string;
 }
 
 - (void)setIcon:(NSImage *)image
 {
-	[_icon autorelease];
-	_icon = [image retain];
+  // BCP: Removed (11/09) per Onne Gorter
+  //	[_icon autorelease];
+  //	_icon = [image retain];
+  // Added:
+	_icon = image;
 }
 
 - (void)setIsActive:(BOOL)yn

Modified: trunk/src/uimacnew/uimacnew.xcodeproj/project.pbxproj
===================================================================
--- trunk/src/uimacnew/uimacnew.xcodeproj/project.pbxproj	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/uimacnew/uimacnew.xcodeproj/project.pbxproj	2009-11-29 13:56:09 UTC (rev 389)
@@ -581,7 +581,7 @@
 					"-lunix",
 					"-lthreadsnat",
 					"-lstr",
-                                        "-lbigarray",
+					"-lbigarray",
 					"-lasmrun",
 				);
 				PREBINDING = NO;
@@ -618,7 +618,7 @@
 					"-lunix",
 					"-lthreadsnat",
 					"-lstr",
-                                        "-lbigarray",
+					"-lbigarray",
 					"-lasmrun",
 				);
 				PREBINDING = NO;
@@ -652,7 +652,7 @@
 					"-lunix",
 					"-lthreadsnat",
 					"-lstr",
-                                        "-lbigarray",
+					"-lbigarray",
 					"-lasmrun",
 				);
 				PREBINDING = NO;

Modified: trunk/src/update.ml
===================================================================
--- trunk/src/update.ml	2009-08-18 13:14:35 UTC (rev 388)
+++ trunk/src/update.ml	2009-11-29 13:56:09 UTC (rev 389)
@@ -634,34 +634,47 @@
      ^ "on each host, containing a text summary of the archive, immediately "
      ^ "after loading it.")
 
+let ignoreArchives =
+  Prefs.createBool "ignorearchives" false
+    "!ignore existing archive files"
+    ("When this preference is set, Unison will ignore any existing "
+     ^ "archive files and behave as though it were being run for the first "
+     ^ "time on these replicas.  It is "
+     ^ "not a good idea to set this option in a profile: it is intended for "
+     ^ "command-line use.")
+
 (* For all roots (local or remote), load the archive and cache *)
 let loadArchives (optimistic: bool) : bool Lwt.t =
-  Globals.allRootsMap (fun r -> loadArchiveOnRoot r optimistic)
-     >>= (fun checksums ->
-  let identicals = archivesIdentical checksums in
-  if not (optimistic || identicals) then
-    raise (Util.Fatal(
-	"Internal error: On-disk archives are not identical.\n"
-      ^ "\n"
-      ^ "This can happen when both machines have the same hostname.\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"
-      ^ "     to join the group before you will be allowed to post).\n"
-      ^ "  b) Move the archive files on each machine to some other directory\n"
-      ^ "     (in case they may be useful for debugging).\n"
-      ^ "     The archive files on this machine are in the directory\n"
-      ^ (Printf.sprintf "       %s\n"
-           (System.fspathToPrintString Os.unisonDir))
-      ^ "     and have names of the form\n"
-      ^ "       arXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"
-      ^ "     where the X's are a hexidecimal number .\n"
-      ^ "  c) Run unison again to synchronize from scratch.\n"));
-  checkArchiveCaseSensitivity checksums >>= fun () ->
-  if Prefs.read dumpArchives then 
-    Globals.allRootsMap (fun r -> dumpArchiveOnRoot r ())
-     >>= (fun _ -> Lwt.return identicals)
-  else Lwt.return identicals)
+  if Prefs.read ignoreArchives then begin
+    Lwt.return false
+  end else  begin
+    Globals.allRootsMap (fun r -> loadArchiveOnRoot r optimistic)
+       >>= (fun checksums ->
+    let identicals = archivesIdentical checksums in
+    if not (optimistic || identicals) then
+      raise (Util.Fatal(
+          "Internal error: On-disk archives are not identical.\n"
+        ^ "\n"
+        ^ "This can happen when both machines have the same hostname.\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"
+        ^ "     to join the group before you will be allowed to post).\n"
+        ^ "  b) Move the archive files on each machine to some other directory\n"
+        ^ "     (in case they may be useful for debugging).\n"
+        ^ "     The archive files on this machine are in the directory\n"
+        ^ (Printf.sprintf "       %s\n"
+             (System.fspathToPrintString Os.unisonDir))
+        ^ "     and have names of the form\n"
+        ^ "       arXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"
+        ^ "     where the X's are a hexidecimal number .\n"
+        ^ "  c) Run unison again to synchronize from scratch.\n"));
+    checkArchiveCaseSensitivity checksums >>= fun () ->
+    if Prefs.read dumpArchives then 
+      Globals.allRootsMap (fun r -> dumpArchiveOnRoot r ())
+       >>= (fun _ -> Lwt.return identicals)
+    else Lwt.return identicals)
+  end
 
 
 (*****************************************************************************)
@@ -785,6 +798,39 @@
 let exists = Safelist.exists (fun x -> x)
 
 let doArchiveCrashRecovery () =
+  let noArchives() = 
+    foundArchives := false;
+    let expectedRoots =
+      String.concat "\n\t" (Safelist.map root2string (Globals.rootsList ())) in
+     Util.warn
+     ("No archive files were found for these roots, whose canonical names are:\n\t"
+     ^ expectedRoots ^ "\nThis can happen either\n"
+     ^ "because this is the first time you have synchronized these roots, \n"
+     ^ "or because you have upgraded Unison to a new version with a different\n"
+     ^ "archive format.  \n\n"
+     ^ "Update detection may take a while on this run if the replicas are \n"
+     ^ "large.\n\n"
+     ^ "Unison will assume that the 'last synchronized state' of both replicas\n"
+     ^ "was completely empty.  This means that any files that are different\n"
+     ^ "will be reported as conflicts, and any files that exist only on one\n"
+     ^ "replica will be judged as new and propagated to the other replica.\n"
+     ^ "If the two replicas are identical, then no changes will be reported.\n\n"
+     ^ "If you see this message repeatedly, it may be because one of your machines\n"
+     ^ "is getting its address from DHCP, which is causing its host name to change\n"
+     ^ "between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME\n"
+     ^ "environment variable for advice on how to correct this.\n"
+     ^ "\n"
+     ^ "Donations to the Unison project are gratefully accepted: \n"
+     ^ "http://www.cis.upenn.edu/~bcpierce/unison\n"
+     ^ "\n"
+     (* ^ "\nThe expected archive names were:\n" ^ expectedNames *) );
+    Lwt.return () in
+
+  (* See if we've been asked to ignore the archives *)
+  if Prefs.read ignoreArchives then
+    noArchives()
+  else
+
   (* Check which hosts have copies of the old/new archive *)
   Globals.allRootsMap (fun r -> archivesExistOnRoot r ()) >>= (fun exl ->
   let oldnamesExist,newnamesExist =
@@ -835,34 +881,10 @@
               "The archive file is missing on some hosts.";
               "For safety, the remaining copies should be deleted."]
              @ whatToDo @
-             ["Please delete archive files as appropriate and try again."]))))
+             ["Please delete archive files as appropriate and try again\n";
+             "or invoke Unison with -ignorearchives flag."]))))
   else begin
-    foundArchives := false;
-    let expectedRoots =
-      String.concat "\n\t" (Safelist.map root2string (Globals.rootsList ())) in
-     Util.warn
-     ("No archive files were found for these roots, whose canonical names are:\n\t"
-     ^ expectedRoots ^ "\nThis can happen either\n"
-     ^ "because this is the first time you have synchronized these roots, \n"
-     ^ "or because you have upgraded Unison to a new version with a different\n"
-     ^ "archive format.  \n\n"
-     ^ "Update detection may take a while on this run if the replicas are \n"
-     ^ "large.\n\n"
-     ^ "Unison will assume that the 'last synchronized state' of both replicas\n"
-     ^ "was completely empty.  This means that any files that are different\n"
-     ^ "will be reported as conflicts, and any files that exist only on one\n"
-     ^ "replica will be judged as new and propagated to the other replica.\n"
-     ^ "If the two replicas are identical, then no changes will be reported.\n\n"
-     ^ "If you see this message repeatedly, it may be because one of your machines\n"
-     ^ "is getting its address from DHCP, which is causing its host name to change\n"
-     ^ "between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME\n"
-     ^ "environment variable for advice on how to correct this.\n"
-     ^ "\n"
-     ^ "Donations to the Unison project are gratefully accepted: \n"
-     ^ "http://www.cis.upenn.edu/~bcpierce/unison\n"
-     ^ "\n"
-     (* ^ "\nThe expected archive names were:\n" ^ expectedNames *) );
-    Lwt.return ()
+    noArchives()
   end))
 
 (*************************************************************************



More information about the Unison-hackers mailing list