From 94d5e606544286d31664cbb9bb79ef86d53f5100 Mon Sep 17 00:00:00 2001 From: Rhyland Klein Date: Mon, 20 Aug 2012 17:01:06 -0400 Subject: [PATCH] cros_workon: Add support for revisions other than master This changes adds support for specifying a revision to use for cros_workon other than master. BUG=chromium-os:33688 TEST=used cros_workon to workon a project, repo synced, and verified the src was not synced to master but to the revision requested. CQ-DEPEND:I3a0166aaf4baa3af008ba24e5e887c0ea6b6ab6e Change-Id: I53cbf2819fc557c3ce6eca08c93a57598a64d85c Signed-off-by: Rhyland Klein Reviewed-on: https://gerrit.chromium.org/gerrit/30914 Commit-Ready: Brian Harring Reviewed-by: Brian Harring --- cros_workon | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cros_workon b/cros_workon index 72637d052b..8c903489bc 100755 --- a/cros_workon +++ b/cros_workon @@ -22,6 +22,8 @@ DEFINE_boolean host "${FLAGS_FALSE}" \ "Uses the host instead of board" DEFINE_string remote "" \ "For non-workon projects, the git remote to use." +DEFINE_string revision "" \ + "Use to override the manifest defined default revision used for a project" DEFINE_string command "git status" \ "The command to be run by forall." DEFINE_boolean all "${FLAGS_FALSE}" \ @@ -275,11 +277,12 @@ regen_manifest_and_sync() { need_repo_sync='yes' for S in "${CROS_WORKON_SRCDIR[@]}"; do local srcdir=$(readlink -m "${S}") + local revision="${FLAGS_revision:+--revision=${FLAGS_revision}}" if [ -z "${FLAGS_remote}" ]; then - loman add --workon "${CROS_WORKON_PROJECT[i]}" + loman add --workon "${CROS_WORKON_PROJECT[i]}" "${revision}" else - loman add --remote "${FLAGS_remote}" "${CROS_WORKON_PROJECT[i]}" \ - "${srcdir#${trunkdir}/}" + loman add --remote "${FLAGS_remote}" "${revision}" \ + "${CROS_WORKON_PROJECT[i]}" "${srcdir#${trunkdir}/}" fi : $(( ++i )) done