From bf81de9c617c6411a287f4531d99b2df1cd5fa3e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 2 Jan 2014 15:34:53 -0500 Subject: [PATCH] r: handle more sandbox options --- .bin/r | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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 -- 2.39.5