update: LOG_DIFF to fix -q
authorTero Marttila <terom@paivola.fi>
Tue, 20 Mar 2012 14:24:58 +0200
changeset 578 a2d87cfd77e4
parent 577 b474e2e6f54e
child 579 12e098a732ed
update: LOG_DIFF to fix -q
lib/update.args
lib/update.updates
lib/update.utils
--- a/lib/update.args	Tue Mar 20 14:15:22 2012 +0200
+++ b/lib/update.args	Tue Mar 20 14:24:58 2012 +0200
@@ -16,6 +16,7 @@
 LOG_SKIP=
 LOG_DEBUG=
 LOG_CMD=
+LOG_DIFF=y
 
 UPDATE_FORCE=
 UPDATE_NOOP=
@@ -80,6 +81,7 @@
                 LOG_UPDATE=
                 LOG_FORCE=
                 LOG_NOOP=
+                LOG_DIFF=
                 ;;
 
             v)  LOG_SKIP=y ;;
--- a/lib/update.updates	Tue Mar 20 14:15:22 2012 +0200
+++ b/lib/update.updates	Tue Mar 20 14:24:58 2012 +0200
@@ -155,7 +155,7 @@
 function do_commit {
     local msg=$1
 
-    indent "    " hg_diff
+    [ $LOG_DIFF ] && indent "    " hg_diff
 
     hg_commit "$msg"
 }
--- a/lib/update.utils	Tue Mar 20 14:15:22 2012 +0200
+++ b/lib/update.utils	Tue Mar 20 14:24:58 2012 +0200
@@ -15,6 +15,12 @@
     "$@" || die "Failed"
 }
 
+## Execute command, prefixing its output on stdout with given indent prefix.
+#
+#   indent  "    " $cmd...
+#
+# Output is kept on stdout, exit status is that of the given command.
+# Also logs the executed command at log_cmd level..
 function indent () {
     local indent=$1; shift