]> git.wh0rd.org Git - home.git/commitdiff
r: handle more sandbox options
authorMike Frysinger <vapier@gentoo.org>
Thu, 2 Jan 2014 20:34:53 +0000 (15:34 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 2 Jan 2014 20:34:53 +0000 (15:34 -0500)
.bin/r

diff --git a/.bin/r b/.bin/r
index 003121a4edd3fc6aaa2d45d6a7b2eec9df69ba67..47a07ad80666834aeabb5f97108324ec7c60276e 100755 (executable)
--- a/.bin/r
+++ b/.bin/r
@@ -165,7 +165,15 @@ clean)
        mj_finish
        exit
        ;;
-sb-push)
+sb)
+       sb_cmd=$1
+       case ${sb_cmd} in
+       pull) ;;
+       push) ;;
+       f|fetch) sb_cmd="fetch" ;;
+       *) err "unknown sandbox command: $1"
+       esac
+
        sync_branch="v"
 
        root=$(repo_root)
@@ -194,8 +202,17 @@ sb-push)
                printf '### (%*i/%i %3i%%) %s\n' \
                        ${#tcnt} $((cnt++)) ${tcnt} $(( cnt * 100 / tcnt )) ${proj}
                src="${sync_branch}"
-               g l -1 ${src} >& /dev/null || src=
-               mj_child g push --force ${remote}/${proj} ${src}:refs/sandbox/${USER}/${sync_branch} >/dev/null
+               case ${sb_cmd} in
+               push)
+                       g l -1 ${src} >& /dev/null || src=
+                       mj_child g push --force ${remote}/${proj} ${src}:refs/sandbox/${USER}/${sync_branch} >/dev/null
+                       ;;
+               pull)
+                       ;;
+               fetch)
+                       mj_child g fetch ${remote}/${proj} refs/sandbox/${USER}/${sync_branch}:refs/remotes/sb/${sync_branch} >/dev/null
+                       ;;
+               esac
        done < <(echo "${rlist}")
        mj_finish