From: Mike Frysinger Date: Thu, 2 Jan 2014 20:34:53 +0000 (-0500) Subject: r: handle more sandbox options X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bf81de9c617c6411a287f4531d99b2df1cd5fa3e;p=home.git r: handle more sandbox options --- diff --git a/.bin/r b/.bin/r index 003121a..47a07ad 100755 --- 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