From 2121ee85f036b9554d071bdde1e12af572cc8037 Mon Sep 17 00:00:00 2001 From: Wilmer Ricciotti Date: Wed, 12 Oct 2011 13:59:15 +0000 Subject: [PATCH] Matitaweb: svn now skips empty add. --- matitaB/matita/matitaFilesystem.ml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) 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 -- 2.39.2