lib/update.hg
branchdns-new
changeset 612 51270237a6ff
parent 605 26a307558602
child 618 a756f317d083
--- a/lib/update.hg	Thu Dec 19 02:30:00 2013 +0200
+++ b/lib/update.hg	Thu Dec 19 02:38:03 2013 +0200
@@ -4,12 +4,13 @@
 
 ## Run `hg ...` within $REPO.
 function hg {
-    cmd $HG "${HG_ARGS[@]}" "$@"
+    local repo=$1; shift
+    cmd $HG -R "$repo" "${HG_ARGS[@]}" "$@"
 }
 
 ## Does the repo have local modifications?
 function hg_modified {
-    hg id | grep -q '+'
+    hg $1 id | grep -q '+'
 }
 
 ## Output possible -u flag for commit.
@@ -29,7 +30,8 @@
 ## Show changes in repo
 #   hg_diff     [path ...]
 function hg_diff {
-    hg diff "$@"
+    local repo=$1; shift
+    hg $repo diff "$@"
 }
 
 ## Commit changes in repo, with given message:
@@ -38,14 +40,13 @@
 #
 # Automatically determines possible -u to use when running with sudo.
 function hg_commit {
-    local msg=$1; shift
+    local repo=$1
+    local msg=$2
     local user_opt=$(hg_user)
     local msg_opt=
 
     [ $msg ] && msg_opt=('-m' "$msg")
     
     debug "$user_opt: $msg"
-    hg commit ${user_opt[@]} ${msg_opt[@]}
+    hg $repo commit ${user_opt[@]} ${msg_opt[@]}
 }
-
-