summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2021-02-09 00:26:31 -0800
committerRaman Tenneti <rtenneti@google.com>2021-02-11 18:59:29 +0000
commit21dce3d8b351538d0fe8c05e6106c8b281580dda (patch)
tree771c7d005adc27acfbfdd7e6e85339766efdb810 /repo
parente3315bb49a782bcf62ba9df4fc1c2690b046763f (diff)
downloadgit-repo-21dce3d8b351538d0fe8c05e6106c8b281580dda.tar.gz
init: added --use-superproject option to clone superproject.v2.12.2
Added --no-use-superproject to repo and init.py to disable use of manifest superprojects. Replaced the term "sha" with "commit id". Added _GetBranch method to Superproject object. Moved shared code between init and sync into SyncSuperproject function. This function either does git clone or git fetch. If git fetch fails it does git clone. Changed Superproject constructor to accept manifest, repodir and branch to avoid passing them to multiple functions as argument. Changed functions that were raising exceptions to return either True or False. Saved the --use-superproject option in config as repo.superproject. Updated internal-fs-layout.md document. Updated the tests to work with the new API changes in Superproject. Performance for the first time sync has improved from 20 minutes to around 15 minutes. Tested the code with the following commands. $ ./run_tests -v Tested the sync code by using repo_dev alias and pointing to this CL. $ repo init took around 20 seconds longer because of cloning of superproject. $ time repo_dev init -u sso://android.git.corp.google.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M --repo-rev=main --use-superproject ... real 0m35.919s user 0m21.947s sys 0m8.977s First run $ time repo sync --use-superproject ... real 16m41.982s user 100m6.916s sys 19m18.753s No difference in repo sync time after the first run. Bug: [google internal] b/179090734 Bug: https://crbug.com/gerrit/13709 Bug: https://crbug.com/gerrit/13707 Change-Id: I12df92112f46e001dfbc6f12cd633c3a15cf924b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/296382 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'repo')
-rwxr-xr-xrepo8
1 files changed, 7 insertions, 1 deletions
diff --git a/repo b/repo
index 83933d7c..63cee031 100755
--- a/repo
+++ b/repo
@@ -324,6 +324,11 @@ def GetParser(gitc_init=False):
324 'each project. See git archive.') 324 'each project. See git archive.')
325 group.add_option('--submodules', action='store_true', 325 group.add_option('--submodules', action='store_true',
326 help='sync any submodules associated with the manifest repo') 326 help='sync any submodules associated with the manifest repo')
327 group.add_option('--use-superproject', action='store_true', default=None,
328 help='use the manifest superproject to sync projects')
329 group.add_option('--no-use-superproject', action='store_false',
330 dest='use_superproject',
331 help='disable use of manifest superprojects')
327 group.add_option('-g', '--groups', default='default', 332 group.add_option('-g', '--groups', default='default',
328 help='restrict manifest projects to ones with specified ' 333 help='restrict manifest projects to ones with specified '
329 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]', 334 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]',
@@ -333,7 +338,8 @@ def GetParser(gitc_init=False):
333 'platform group [auto|all|none|linux|darwin|...]', 338 'platform group [auto|all|none|linux|darwin|...]',
334 metavar='PLATFORM') 339 metavar='PLATFORM')
335 group.add_option('--clone-bundle', action='store_true', 340 group.add_option('--clone-bundle', action='store_true',
336 help='enable use of /clone.bundle on HTTP/HTTPS (default if not --partial-clone)') 341 help='enable use of /clone.bundle on HTTP/HTTPS '
342 '(default if not --partial-clone)')
337 group.add_option('--no-clone-bundle', 343 group.add_option('--no-clone-bundle',
338 dest='clone_bundle', action='store_false', 344 dest='clone_bundle', action='store_false',
339 help='disable use of /clone.bundle on HTTP/HTTPS (default if --partial-clone)') 345 help='disable use of /clone.bundle on HTTP/HTTPS (default if --partial-clone)')