From 24f2cc0de131c95d25fcbf30369764272f0539f2 Mon Sep 17 00:00:00 2001 From: Don Garrett Date: Tue, 18 Dec 2018 18:07:17 +0000 Subject: [PATCH] repo: Update the repo tool to 1.24. R=-owners Bug: None Change-Id: I9ff818b65b1c9a2a3a19f65932ffac4957dab0cc Reviewed-on: https://chromium-review.googlesource.com/c/1382934 Auto-Submit: Don Garrett Reviewed-by: Andrii Shyshkalov Commit-Queue: Don Garrett --- repo | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/repo b/repo index 0b8090d0bd..abd74ca430 100755 --- a/repo +++ b/repo @@ -23,10 +23,13 @@ REPO_REV = 'stable' # limitations under the License. # increment this whenever we make important changes to this script -VERSION = (1, 23) +VERSION = (1, 24) # increment this if the MAINTAINER_KEYS block is modified KEYRING_VERSION = (1, 5) + +# Each individual key entry is created by using: +# gpg --armor --export keyid MAINTAINER_KEYS = """ Repo Maintainer @@ -244,6 +247,7 @@ GITC_FS_ROOT_DIR = '/gitc/manifest-rw/' import errno import optparse +import platform import re import shutil import stat @@ -299,6 +303,9 @@ group.add_option('-b', '--manifest-branch', group.add_option('-m', '--manifest-name', dest='manifest_name', help='initial manifest file', metavar='NAME.xml') +group.add_option('-c', '--current-branch', + dest='current_branch_only', action='store_true', + help='fetch only current manifest branch from server') group.add_option('--mirror', dest='mirror', action='store_true', help='create a replica of the remote repositories ' @@ -313,6 +320,9 @@ group.add_option('--archive', dest='archive', action='store_true', help='checkout an archive instead of a git repository for ' 'each project. See git archive.') +group.add_option('--submodules', + dest='submodules', action='store_true', + help='sync any submodules associated with the manifest repo') group.add_option('-g', '--groups', dest='groups', default='default', help='restrict manifest projects to ones with specified ' @@ -326,6 +336,9 @@ group.add_option('-p', '--platform', group.add_option('--no-clone-bundle', dest='no_clone_bundle', action='store_true', help='disable use of /clone.bundle on HTTP/HTTPS') +group.add_option('--no-tags', + dest='no_tags', action='store_true', + help="don't fetch tags in the manifest") # Tool @@ -471,6 +484,10 @@ def _Init(args, gitc_init=False): dst = os.path.abspath(os.path.join(repodir, S_repo)) _Clone(url, dst, opt.quiet, not opt.no_clone_bundle) + if not os.path.isfile('%s/repo' % dst): + _print("warning: '%s' does not look like a git-repo repository, is " + "REPO_URL set correctly?" % url, file=sys.stderr) + if can_verify and not opt.no_repo_verify: rev = _Verify(dst, branch, opt.quiet) else: @@ -977,7 +994,10 @@ def main(orig_args): try: _Init(args, gitc_init=(cmd == 'gitc-init')) except CloneFailure: - shutil.rmtree(os.path.join(repodir, S_repo), ignore_errors=True) + path = os.path.join(repodir, S_repo) + _print("fatal: cloning the git-repo repository failed, will remove " + "'%s' " % path, file=sys.stderr) + shutil.rmtree(path, ignore_errors=True) sys.exit(1) repo_main, rel_repo_dir = _FindRepo() else: @@ -995,7 +1015,10 @@ def main(orig_args): me.extend(orig_args) me.extend(extra_args) try: - os.execv(sys.executable, me) + if platform.system() == "Windows": + sys.exit(subprocess.call(me)) + else: + os.execv(sys.executable, me) except OSError as e: _print("fatal: unable to start %s" % repo_main, file=sys.stderr) _print("fatal: %s" % e, file=sys.stderr)