From: Wilmer Ricciotti Date: Wed, 12 Oct 2011 13:59:15 +0000 (+0000) Subject: Matitaweb: svn now skips empty add. X-Git-Tag: make_still_working~2199 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=2121ee85f036b9554d071bdde1e12af572cc8037;p=helm.git Matitaweb: svn now skips empty add. --- diff --git a/matitaB/matita/matitaFilesystem.ml b/matitaB/matita/matitaFilesystem.ml index 7ad9287df..08279eeac 100644 --- a/matitaB/matita/matitaFilesystem.ml +++ b/matitaB/matita/matitaFilesystem.ml @@ -303,20 +303,22 @@ let update_user user = ;; let add_files user files = - let rt_dir = Helm_registry.get "matita.rt_base_dir" in - let _repo = Helm_registry.get "matita.weblib" in - - let files = String.concat " " - (List.map ((^) (rt_dir ^ "/users/" ^ user ^ "/")) files) in - - let errno, outlines, errlines = - if files <> "" then - exec_process ("svn add --non-interactive " ^ files) - else 0,[],[] - in - if errno = 0 then - "BEGIN ADD - " ^ user ^ ":\n" ^ (string_of_output outlines errlines) ^ "END ADD - " ^ user ^ "\n\n" - else raise (SvnError (string_of_output outlines errlines)) + if (List.length files > 0) then + (let rt_dir = Helm_registry.get "matita.rt_base_dir" in + let _repo = Helm_registry.get "matita.weblib" in + + let files = String.concat " " + (List.map ((^) (rt_dir ^ "/users/" ^ user ^ "/")) files) in + + let errno, outlines, errlines = + if files <> "" then + exec_process ("svn add --non-interactive " ^ files) + else 0,[],[] + in + if errno = 0 then + "BEGIN ADD - " ^ user ^ ":\n" ^ (string_of_output outlines errlines) ^ "END ADD - " ^ user ^ "\n\n" + else raise (SvnError (string_of_output outlines errlines))) + else ("ADD - nothing to do for " ^ user ^ "\n") ;; (* this function should only be called by the server itself (or