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)
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