From 19607b28172c3be8153fa0c44326052929fe8653 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 5 Feb 2020 23:52:07 -0500 Subject: [PATCH] repo: allow REPO_REV to be an env var We do this for REPO_URL already. Bug: https://crbug.com/gerrit/10233 Change-Id: I53410645474b00d900467c96fa5d8446f3a607d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253552 Reviewed-by: David Pursehouse Tested-by: Mike Frysinger (cherry picked from commit 563f1a651298eaa3616f92c3cd7b264fe5442379) --- repo | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/repo b/repo index c910bd90..b9e29ba6 100755 --- a/repo +++ b/repo @@ -16,7 +16,9 @@ import os REPO_URL = os.environ.get('REPO_URL', None) if not REPO_URL: REPO_URL = 'https://gerrit.googlesource.com/git-repo' -REPO_REV = 'repo-1' +REPO_REV = os.environ.get('REPO_REV') +if not REPO_REV: + REPO_REV = 'repo-1' # Copyright (C) 2008 Google Inc. # @@ -235,10 +237,10 @@ group.add_option('--no-tags', group = init_optparse.add_option_group('repo Version options') group.add_option('--repo-url', dest='repo_url', - help='repo repository location', metavar='URL') + help='repo repository location ($REPO_URL)', metavar='URL') group.add_option('--repo-branch', dest='repo_branch', - help='repo branch or revision', metavar='REVISION') + help='repo branch or revision ($REPO_REV)', metavar='REVISION') group.add_option('--no-repo-verify', dest='no_repo_verify', action='store_true', help='do not verify repo source code')