--- a/lib/update.operations Thu Dec 19 23:22:12 2013 +0200
+++ b/lib/update.operations Thu Dec 19 23:52:17 2013 +0200
@@ -334,24 +334,13 @@
}
### Commit
-## Perform `hg commit`
-function do_commit {
- local repo=$1
- local msg=$1
-
- [ $LOG_DIFF ] && indent " " hg_diff $repo
-
- hg_commit $repo "$msg"
-}
-
-
## Commit changes to version control:
#
-# commit_data
+# update_commit .../etc "commit message"
#
# Invokes `hg commit`, first showing the diff.
function update_commit {
- local repo=$1
+ local repo="$1"
local commit_msg="$COMMIT_MSG"
local msg="Commit changes"
@@ -360,19 +349,23 @@
if [ $COMMIT_FORCE ]; then
log_force "$msg: $commit_msg"
- do_commit "$commit_msg"
+ [ $LOG_DIFF ] && indent " " hg_diff $repo
- elif ! hg_modified $repo; then
+ hg_commit "$repo" "$commit_msg"
+
+ elif ! hg_modified "$repo"; then
log_warn "$msg: no changes"
elif [ $COMMIT_SKIP ]; then
log_noop "$msg: skipped"
# still show diff, though
- [ $LOG_DIFF ] && indent " " hg_diff $repo
+ [ $LOG_DIFF ] && indent " " hg_diff "$repo"
else
log_update "$msg: $commit_msg"
- do_commit $repo "$commit_msg"
+ [ $LOG_DIFF ] && indent " " hg_diff $repo
+
+ hg_commit "$repo" "$commit_msg"
fi
}