From 563f1a651298eaa3616f92c3cd7b264fe5442379 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 --- repo | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/repo b/repo index 95a212db..2b125296 100755 --- a/repo +++ b/repo @@ -94,7 +94,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 = 'stable' +REPO_REV = os.environ.get('REPO_REV') +if not REPO_REV: + REPO_REV = 'stable' # Copyright (C) 2008 Google Inc. # @@ -266,10 +268,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')