$OpenBSD: patch-update_ml,v 1.1 2005/05/30 19:27:45 sturm Exp $
Post-release developer patch.
o Better error message for non-existing paths.
  See http://lists.seas.upenn.edu/pipermail/unison-hackers/2005-May/000092.html
o Update archive timestamps to avoid defeating fastcheck on Windows.
  See http://groups.yahoo.com/group/unison-users/message/3821
--- update.ml.orig	Sat Mar 12 11:17:58 2005
+++ update.ml	Fri May 27 17:27:12 2005
@@ -1587,7 +1587,6 @@ and buildUpdateRec archive currfspath pa
 let rec buildUpdate archive fspath fullpath here path =
   match Path.deconstruct path with
     None ->
-      Os.checkThatParentPathIsADir fspath here;
       showStatus path;
       let (arch, ui) =
         buildUpdateRec archive fspath here (useFastChecking()) in
@@ -1597,6 +1596,12 @@ let rec buildUpdate archive fspath fullp
        end,
        ui)
   | Some(name, path') ->
+      if not (isDir fspath here) then
+        (archive,
+         Error (Printf.sprintf
+                  "path %s is not valid because %s is not a directory"
+                  (Path.toString fullpath) (Path.toString here)))
+      else
       let children = getChildren fspath here in
       let (name', status) =
         try
@@ -1634,7 +1639,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
