From e91d2d1a3c89c67605b393657697a9cc8f02956e Mon Sep 17 00:00:00 2001 From: Wilmer Ricciotti Date: Wed, 12 Oct 2011 14:02:22 +0000 Subject: [PATCH] Matitaweb: svn now skips empty commits. --- matitaB/matita/matitaFilesystem.ml | 26 ++++++++++++++------------ matitaB/matita/netplex.conf | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/matitaB/matita/matitaFilesystem.ml b/matitaB/matita/matitaFilesystem.ml index 08279eeac..1ea3cbb94 100644 --- a/matitaB/matita/matitaFilesystem.ml +++ b/matitaB/matita/matitaFilesystem.ml @@ -325,17 +325,19 @@ let add_files user files = * the admin) at a scheduled time, so no concurrent instances and no CS needed * also, svn should already be safe as far as concurrency is concerned *) let commit 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 = exec_process - ("svn ci --non-interactive --message \"commit by user " ^ user ^ "\" " ^ files) - in - if errno = 0 then - "BEGIN COMMIT - " ^ user ^ ":\n" ^ (string_of_output outlines errlines) ^ "END COMMIT - " ^ 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 = exec_process + ("svn ci --non-interactive --message \"commit by user " ^ user ^ "\" " ^ files) + in + if errno = 0 then + "BEGIN COMMIT - " ^ user ^ ":\n" ^ (string_of_output outlines errlines) ^ "END COMMIT - " ^ user ^ "\n\n" + else raise (SvnError (string_of_output outlines errlines))) + else ("COMMIT nothing to do for " ^ user ^ "\n") ;; diff --git a/matitaB/matita/netplex.conf b/matitaB/matita/netplex.conf index 5e947c28b..ff6a76d60 100644 --- a/matitaB/matita/netplex.conf +++ b/matitaB/matita/netplex.conf @@ -27,7 +27,7 @@ netplex { path = "/"; service { type = "file"; - docroot = "/home/matitaweb/matita/matita"; + docroot = "/home/barolo/matitaB/matita"; media_types_file = "/etc/mime.types"; enable_listings = true; } -- 2.39.2