update: hardcode $REPO in hg
authorTero Marttila <terom@paivola.fi>
Tue, 20 Mar 2012 12:06:31 +0200
changeset 39 57551a87a93e
parent 38 39799fc994e9
child 40 d99ebc15833d
update: hardcode $REPO in hg
bin/update
--- a/bin/update	Tue Mar 20 11:49:16 2012 +0200
+++ b/bin/update	Tue Mar 20 12:06:31 2012 +0200
@@ -233,15 +233,13 @@
 
 ## hg
 function hg {
-    local repo=$1; shift
+    local repo=$REPO; shift
 
     cmd $HG -R $ROOT/$repo "$@"
 }
 
 function hg_modified {
-    local repo=$1
-
-    hg $repo id | grep -q '+'
+    hg id | grep -q '+'
 }
 
 function hg_user {
@@ -258,18 +256,15 @@
 }
 
 function hg_diff {
-    local repo=$1
-
-    hg $repo diff
+    hg diff
 }
 
 function hg_commit {
-    local repo=$1
     local msg=$2
     local user_opt=$(hg_user)
     
     log_debug "commit: $user_opt: $msg"
-    hg $repo commit $user_opt -m "$msg"
+    hg commit $user_opt -m "$msg"
 }
 
 
@@ -556,14 +551,14 @@
 
 # commit data changes
 function commit_data {
-    local repo=$1
+    local repo=$REPO
 
-    if hg_modified $repo; then
+    if hg_modified; then
         log_info "Commit changes in $repo:"
 
-        indent "    " hg_diff $repo
+        indent "    " hg_diff
 
-        hg_commit $repo "$COMMIT_MSG"
+        hg_commit "$COMMIT_MSG"
     else
         log_info "Commit changes in $repo: no changes"
     fi
@@ -692,7 +687,7 @@
 
     else
         log "Commit data..."
-            commit_data $REPO
+            commit_data
     fi
 }