libv8 8.4.255.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.gitmodules +3 -0
- data/.rspec +3 -0
- data/.travis.yml +45 -0
- data/CHANGELOG.md +111 -0
- data/Gemfile +4 -0
- data/README.md +152 -0
- data/Rakefile +125 -0
- data/appveyor.yml.disabled +36 -0
- data/ext/libv8/arch.rb +20 -0
- data/ext/libv8/builder.rb +106 -0
- data/ext/libv8/extconf.rb +7 -0
- data/ext/libv8/location.rb +89 -0
- data/ext/libv8/paths.rb +28 -0
- data/lib/libv8.rb +9 -0
- data/lib/libv8/version.rb +3 -0
- data/libv8.gemspec +30 -0
- data/scaleway.png +0 -0
- data/spec/location_spec.rb +69 -0
- data/spec/spec_helper.rb +4 -0
- data/thefrontside.png +0 -0
- data/vendor/depot_tools/.cipd_impl.ps1 +129 -0
- data/vendor/depot_tools/.gitattributes +55 -0
- data/vendor/depot_tools/.gitignore +92 -0
- data/vendor/depot_tools/.style.yapf +4 -0
- data/vendor/depot_tools/.vpython +55 -0
- data/vendor/depot_tools/.vpython3 +23 -0
- data/vendor/depot_tools/CROS_OWNERS +7 -0
- data/vendor/depot_tools/GOMA_OWNERS +9 -0
- data/vendor/depot_tools/LICENSE +27 -0
- data/vendor/depot_tools/LUCI_OWNERS +5 -0
- data/vendor/depot_tools/OWNERS +39 -0
- data/vendor/depot_tools/PRESUBMIT.py +150 -0
- data/vendor/depot_tools/README.gclient.md +67 -0
- data/vendor/depot_tools/README.git-cl.md +99 -0
- data/vendor/depot_tools/README.md +78 -0
- data/vendor/depot_tools/WATCHLISTS +26 -0
- data/vendor/depot_tools/auth.py +163 -0
- data/vendor/depot_tools/autoninja +36 -0
- data/vendor/depot_tools/autoninja.bat +33 -0
- data/vendor/depot_tools/autoninja.py +148 -0
- data/vendor/depot_tools/bb +12 -0
- data/vendor/depot_tools/bb.bat +7 -0
- data/vendor/depot_tools/bootstrap/README.md +155 -0
- data/vendor/depot_tools/bootstrap/bootstrap.py +356 -0
- data/vendor/depot_tools/bootstrap/git-bash.template.sh +12 -0
- data/vendor/depot_tools/bootstrap/git.template.bat +5 -0
- data/vendor/depot_tools/bootstrap/manifest.txt +27 -0
- data/vendor/depot_tools/bootstrap/manifest_bleeding_edge.txt +27 -0
- data/vendor/depot_tools/bootstrap/profile.d.python.sh +20 -0
- data/vendor/depot_tools/bootstrap/python27.bat +46 -0
- data/vendor/depot_tools/bootstrap/python3.bat +46 -0
- data/vendor/depot_tools/bootstrap/win_tools.bat +79 -0
- data/vendor/depot_tools/bootstrap_python3 +35 -0
- data/vendor/depot_tools/breakpad.py +12 -0
- data/vendor/depot_tools/cbuildbot +1 -0
- data/vendor/depot_tools/chrome_set_ver +1 -0
- data/vendor/depot_tools/cipd +247 -0
- data/vendor/depot_tools/cipd.bat +67 -0
- data/vendor/depot_tools/cipd_bin_setup.bat +6 -0
- data/vendor/depot_tools/cipd_bin_setup.sh +22 -0
- data/vendor/depot_tools/cipd_client_version +1 -0
- data/vendor/depot_tools/cipd_client_version.digests +22 -0
- data/vendor/depot_tools/cipd_manifest.txt +63 -0
- data/vendor/depot_tools/cipd_manifest.versions +438 -0
- data/vendor/depot_tools/cit +8 -0
- data/vendor/depot_tools/cit.bat +12 -0
- data/vendor/depot_tools/cit.py +167 -0
- data/vendor/depot_tools/clang-format +8 -0
- data/vendor/depot_tools/clang-format.bat +12 -0
- data/vendor/depot_tools/clang_format.py +79 -0
- data/vendor/depot_tools/clang_format_merge_driver +8 -0
- data/vendor/depot_tools/clang_format_merge_driver.bat +12 -0
- data/vendor/depot_tools/clang_format_merge_driver.py +69 -0
- data/vendor/depot_tools/codereview.settings +6 -0
- data/vendor/depot_tools/compile_single_file +8 -0
- data/vendor/depot_tools/compile_single_file.bat +11 -0
- data/vendor/depot_tools/compile_single_file.py +79 -0
- data/vendor/depot_tools/cpplint.bat +11 -0
- data/vendor/depot_tools/cpplint.py +6097 -0
- data/vendor/depot_tools/cpplint_chromium.py +50 -0
- data/vendor/depot_tools/cros +87 -0
- data/vendor/depot_tools/cros_sdk +1 -0
- data/vendor/depot_tools/crosjobs +13 -0
- data/vendor/depot_tools/detect_host_arch.py +55 -0
- data/vendor/depot_tools/dirmd +12 -0
- data/vendor/depot_tools/dirmd.bat +7 -0
- data/vendor/depot_tools/download_from_google_storage +8 -0
- data/vendor/depot_tools/download_from_google_storage.bat +12 -0
- data/vendor/depot_tools/download_from_google_storage.py +634 -0
- data/vendor/depot_tools/ensure_bootstrap +53 -0
- data/vendor/depot_tools/fetch +21 -0
- data/vendor/depot_tools/fetch.bat +28 -0
- data/vendor/depot_tools/fetch.py +319 -0
- data/vendor/depot_tools/fetch_configs/android.py +34 -0
- data/vendor/depot_tools/fetch_configs/android_internal.py +34 -0
- data/vendor/depot_tools/fetch_configs/breakpad.py +44 -0
- data/vendor/depot_tools/fetch_configs/chromium.py +66 -0
- data/vendor/depot_tools/fetch_configs/config_util.py +52 -0
- data/vendor/depot_tools/fetch_configs/crashpad.py +41 -0
- data/vendor/depot_tools/fetch_configs/dart.py +45 -0
- data/vendor/depot_tools/fetch_configs/depot_tools.py +44 -0
- data/vendor/depot_tools/fetch_configs/devtools-frontend.py +44 -0
- data/vendor/depot_tools/fetch_configs/goma_client.py +41 -0
- data/vendor/depot_tools/fetch_configs/gyp.py +41 -0
- data/vendor/depot_tools/fetch_configs/infra.py +40 -0
- data/vendor/depot_tools/fetch_configs/infra_internal.py +45 -0
- data/vendor/depot_tools/fetch_configs/inspector_protocol.py +40 -0
- data/vendor/depot_tools/fetch_configs/ios.py +34 -0
- data/vendor/depot_tools/fetch_configs/ios_internal.py +39 -0
- data/vendor/depot_tools/fetch_configs/nacl.py +48 -0
- data/vendor/depot_tools/fetch_configs/naclports.py +47 -0
- data/vendor/depot_tools/fetch_configs/node-ci.py +41 -0
- data/vendor/depot_tools/fetch_configs/pdfium.py +40 -0
- data/vendor/depot_tools/fetch_configs/skia.py +41 -0
- data/vendor/depot_tools/fetch_configs/skia_buildbot.py +41 -0
- data/vendor/depot_tools/fetch_configs/syzygy.py +41 -0
- data/vendor/depot_tools/fetch_configs/v8.py +44 -0
- data/vendor/depot_tools/fetch_configs/webrtc.py +52 -0
- data/vendor/depot_tools/fetch_configs/webrtc_android.py +34 -0
- data/vendor/depot_tools/fetch_configs/webrtc_ios.py +34 -0
- data/vendor/depot_tools/fix_encoding.py +385 -0
- data/vendor/depot_tools/gclient +38 -0
- data/vendor/depot_tools/gclient-new-workdir.py +124 -0
- data/vendor/depot_tools/gclient.bat +32 -0
- data/vendor/depot_tools/gclient.py +3198 -0
- data/vendor/depot_tools/gclient_completion.sh +76 -0
- data/vendor/depot_tools/gclient_eval.py +891 -0
- data/vendor/depot_tools/gclient_paths.py +152 -0
- data/vendor/depot_tools/gclient_scm.py +1615 -0
- data/vendor/depot_tools/gclient_utils.py +1280 -0
- data/vendor/depot_tools/gerrit_client.py +151 -0
- data/vendor/depot_tools/gerrit_util.py +996 -0
- data/vendor/depot_tools/git-cache +6 -0
- data/vendor/depot_tools/git-cl +6 -0
- data/vendor/depot_tools/git-crrev-parse +53 -0
- data/vendor/depot_tools/git-drover +6 -0
- data/vendor/depot_tools/git-find-releases +6 -0
- data/vendor/depot_tools/git-footers +6 -0
- data/vendor/depot_tools/git-freeze +8 -0
- data/vendor/depot_tools/git-gs +9 -0
- data/vendor/depot_tools/git-hyper-blame +6 -0
- data/vendor/depot_tools/git-map +6 -0
- data/vendor/depot_tools/git-map-branches +6 -0
- data/vendor/depot_tools/git-mark-merge-base +6 -0
- data/vendor/depot_tools/git-nav-downstream +6 -0
- data/vendor/depot_tools/git-nav-upstream +6 -0
- data/vendor/depot_tools/git-new-branch +6 -0
- data/vendor/depot_tools/git-number +6 -0
- data/vendor/depot_tools/git-rebase-update +6 -0
- data/vendor/depot_tools/git-rename-branch +6 -0
- data/vendor/depot_tools/git-reparent-branch +6 -0
- data/vendor/depot_tools/git-retry +8 -0
- data/vendor/depot_tools/git-runhooks +23 -0
- data/vendor/depot_tools/git-squash-branch +6 -0
- data/vendor/depot_tools/git-templates/description +3 -0
- data/vendor/depot_tools/git-templates/hooks/applypatch-msg +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-applypatch +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-checkout +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-commit +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-merge +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-update +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-applypatch +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-auto-gc +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-commit +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-rebase +4 -0
- data/vendor/depot_tools/git-templates/hooks/prepare-commit-msg +4 -0
- data/vendor/depot_tools/git-templates/info/exclude +6 -0
- data/vendor/depot_tools/git-thaw +13 -0
- data/vendor/depot_tools/git-upstream-diff +9 -0
- data/vendor/depot_tools/git_cache.py +786 -0
- data/vendor/depot_tools/git_cl.py +5158 -0
- data/vendor/depot_tools/git_cl_completion.sh +48 -0
- data/vendor/depot_tools/git_common.py +1101 -0
- data/vendor/depot_tools/git_dates.py +62 -0
- data/vendor/depot_tools/git_drover.py +469 -0
- data/vendor/depot_tools/git_find_releases.py +67 -0
- data/vendor/depot_tools/git_footers.py +261 -0
- data/vendor/depot_tools/git_freezer.py +40 -0
- data/vendor/depot_tools/git_hyper_blame.py +391 -0
- data/vendor/depot_tools/git_map.py +166 -0
- data/vendor/depot_tools/git_map_branches.py +354 -0
- data/vendor/depot_tools/git_mark_merge_base.py +73 -0
- data/vendor/depot_tools/git_nav_downstream.py +69 -0
- data/vendor/depot_tools/git_new_branch.py +82 -0
- data/vendor/depot_tools/git_number.py +301 -0
- data/vendor/depot_tools/git_rebase_update.py +351 -0
- data/vendor/depot_tools/git_rename_branch.py +55 -0
- data/vendor/depot_tools/git_reparent_branch.py +101 -0
- data/vendor/depot_tools/git_retry.py +181 -0
- data/vendor/depot_tools/git_squash_branch.py +28 -0
- data/vendor/depot_tools/git_upstream_diff.py +64 -0
- data/vendor/depot_tools/gn +8 -0
- data/vendor/depot_tools/gn.bat +12 -0
- data/vendor/depot_tools/gn.py +78 -0
- data/vendor/depot_tools/goma_auth +12 -0
- data/vendor/depot_tools/goma_auth.bat +8 -0
- data/vendor/depot_tools/goma_ctl +12 -0
- data/vendor/depot_tools/goma_ctl.bat +8 -0
- data/vendor/depot_tools/gsutil.py +190 -0
- data/vendor/depot_tools/gsutil.py.bat +23 -0
- data/vendor/depot_tools/gsutil.vpython +120 -0
- data/vendor/depot_tools/infra/README.md +1 -0
- data/vendor/depot_tools/infra/config/OWNERS +7 -0
- data/vendor/depot_tools/infra/config/README.md +1 -0
- data/vendor/depot_tools/infra/config/recipes.cfg +26 -0
- data/vendor/depot_tools/led +12 -0
- data/vendor/depot_tools/led.bat +7 -0
- data/vendor/depot_tools/lockfile.py +116 -0
- data/vendor/depot_tools/luci-auth +13 -0
- data/vendor/depot_tools/luci-auth.bat +8 -0
- data/vendor/depot_tools/lucicfg +12 -0
- data/vendor/depot_tools/lucicfg.bat +7 -0
- data/vendor/depot_tools/mac_toolchain +12 -0
- data/vendor/depot_tools/man/html/depot_tools.html +934 -0
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +1593 -0
- data/vendor/depot_tools/man/html/git-cl.html +1033 -0
- data/vendor/depot_tools/man/html/git-drover.html +1048 -0
- data/vendor/depot_tools/man/html/git-footers.html +878 -0
- data/vendor/depot_tools/man/html/git-freeze.html +859 -0
- data/vendor/depot_tools/man/html/git-hyper-blame.html +878 -0
- data/vendor/depot_tools/man/html/git-map-branches.html +904 -0
- data/vendor/depot_tools/man/html/git-map.html +887 -0
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +826 -0
- data/vendor/depot_tools/man/html/git-nav-downstream.html +844 -0
- data/vendor/depot_tools/man/html/git-nav-upstream.html +853 -0
- data/vendor/depot_tools/man/html/git-new-branch.html +932 -0
- data/vendor/depot_tools/man/html/git-rebase-update.html +961 -0
- data/vendor/depot_tools/man/html/git-rename-branch.html +794 -0
- data/vendor/depot_tools/man/html/git-reparent-branch.html +847 -0
- data/vendor/depot_tools/man/html/git-retry.html +858 -0
- data/vendor/depot_tools/man/html/git-squash-branch.html +881 -0
- data/vendor/depot_tools/man/html/git-thaw.html +794 -0
- data/vendor/depot_tools/man/html/git-upstream-diff.html +923 -0
- data/vendor/depot_tools/man/man1/git-cl.1 +198 -0
- data/vendor/depot_tools/man/man1/git-drover.1 +330 -0
- data/vendor/depot_tools/man/man1/git-footers.1 +144 -0
- data/vendor/depot_tools/man/man1/git-freeze.1 +113 -0
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +128 -0
- data/vendor/depot_tools/man/man1/git-map-branches.1 +210 -0
- data/vendor/depot_tools/man/man1/git-map.1 +179 -0
- data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +69 -0
- data/vendor/depot_tools/man/man1/git-nav-downstream.1 +112 -0
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +122 -0
- data/vendor/depot_tools/man/man1/git-new-branch.1 +176 -0
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +177 -0
- data/vendor/depot_tools/man/man1/git-rename-branch.1 +53 -0
- data/vendor/depot_tools/man/man1/git-reparent-branch.1 +93 -0
- data/vendor/depot_tools/man/man1/git-retry.1 +108 -0
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +129 -0
- data/vendor/depot_tools/man/man1/git-thaw.1 +54 -0
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +153 -0
- data/vendor/depot_tools/man/man7/depot_tools.7 +139 -0
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +1061 -0
- data/vendor/depot_tools/man/push_to_gs.sh +4 -0
- data/vendor/depot_tools/man/src/.gitignore +5 -0
- data/vendor/depot_tools/man/src/_aliases.txt +5 -0
- data/vendor/depot_tools/man/src/_footer.txt +8 -0
- data/vendor/depot_tools/man/src/_git-cl_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-drover_desc.helper.txt +2 -0
- data/vendor/depot_tools/man/src/_git-footers_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-freeze_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-hyper-blame_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-map-branches_desc.helper.txt +4 -0
- data/vendor/depot_tools/man/src/_git-map_desc.helper.txt +3 -0
- data/vendor/depot_tools/man/src/_git-mark-merge-base_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-nav-downstream_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-nav-upstream_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-new-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-rebase-update_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-rename-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-reparent-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-retry_desc.helper.txt +2 -0
- data/vendor/depot_tools/man/src/_git-squash-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-thaw_desc.helper.txt +2 -0
- data/vendor/depot_tools/man/src/_git-upstream-diff_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_helper_prefix.txt +1 -0
- data/vendor/depot_tools/man/src/asciidoc-override.css +7 -0
- data/vendor/depot_tools/man/src/common_demo_functions.sh +84 -0
- data/vendor/depot_tools/man/src/demo_repo.sh +43 -0
- data/vendor/depot_tools/man/src/depot_tools.txt +28 -0
- data/vendor/depot_tools/man/src/depot_tools_tutorial.demo.walkthrough.sh +155 -0
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +432 -0
- data/vendor/depot_tools/man/src/filter_demo_output.py +141 -0
- data/vendor/depot_tools/man/src/git-cl.txt +119 -0
- data/vendor/depot_tools/man/src/git-drover.demo.1.sh +22 -0
- data/vendor/depot_tools/man/src/git-drover.demo.2.sh +23 -0
- data/vendor/depot_tools/man/src/git-drover.demo.3.sh +27 -0
- data/vendor/depot_tools/man/src/git-drover.demo.4.sh +39 -0
- data/vendor/depot_tools/man/src/git-drover.demo.common.sh +19 -0
- data/vendor/depot_tools/man/src/git-drover.txt +102 -0
- data/vendor/depot_tools/man/src/git-footers.demo.1.sh +17 -0
- data/vendor/depot_tools/man/src/git-footers.txt +71 -0
- data/vendor/depot_tools/man/src/git-freeze.demo.1.sh +23 -0
- data/vendor/depot_tools/man/src/git-freeze.txt +54 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.demo.1.sh +3 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.demo.2.sh +4 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.demo.common.sh +57 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.txt +85 -0
- data/vendor/depot_tools/man/src/git-map-branches.demo.1.sh +8 -0
- data/vendor/depot_tools/man/src/git-map-branches.txt +64 -0
- data/vendor/depot_tools/man/src/git-map.demo.1.sh +3 -0
- data/vendor/depot_tools/man/src/git-map.txt +67 -0
- data/vendor/depot_tools/man/src/git-mark-merge-base.txt +46 -0
- data/vendor/depot_tools/man/src/git-nav-downstream.demo.1.sh +12 -0
- data/vendor/depot_tools/man/src/git-nav-downstream.txt +40 -0
- data/vendor/depot_tools/man/src/git-nav-upstream.demo.1.sh +12 -0
- data/vendor/depot_tools/man/src/git-nav-upstream.txt +39 -0
- data/vendor/depot_tools/man/src/git-new-branch.demo.1.sh +17 -0
- data/vendor/depot_tools/man/src/git-new-branch.txt +82 -0
- data/vendor/depot_tools/man/src/git-rebase-update.txt +141 -0
- data/vendor/depot_tools/man/src/git-rename-branch.txt +28 -0
- data/vendor/depot_tools/man/src/git-reparent-branch.txt +61 -0
- data/vendor/depot_tools/man/src/git-retry.txt +67 -0
- data/vendor/depot_tools/man/src/git-squash-branch.demo.1.sh +12 -0
- data/vendor/depot_tools/man/src/git-squash-branch.txt +59 -0
- data/vendor/depot_tools/man/src/git-thaw.txt +29 -0
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +107 -0
- data/vendor/depot_tools/man/src/make_docs.sh +260 -0
- data/vendor/depot_tools/man/src/prep_demo_repo.sh +103 -0
- data/vendor/depot_tools/metrics.README.md +101 -0
- data/vendor/depot_tools/metrics.py +297 -0
- data/vendor/depot_tools/metrics_utils.py +293 -0
- data/vendor/depot_tools/my_activity.py +971 -0
- data/vendor/depot_tools/ninja +44 -0
- data/vendor/depot_tools/ninja-linux32 +0 -0
- data/vendor/depot_tools/ninja-linux64 +0 -0
- data/vendor/depot_tools/ninja-mac +0 -0
- data/vendor/depot_tools/ninja.exe +0 -0
- data/vendor/depot_tools/ninjalog.README.md +64 -0
- data/vendor/depot_tools/ninjalog_uploader.py +233 -0
- data/vendor/depot_tools/ninjalog_uploader_wrapper.py +125 -0
- data/vendor/depot_tools/owners.py +641 -0
- data/vendor/depot_tools/owners_finder.py +385 -0
- data/vendor/depot_tools/post_build_ninja_summary.py +350 -0
- data/vendor/depot_tools/presubmit_canned_checks.py +1655 -0
- data/vendor/depot_tools/presubmit_support.py +1923 -0
- data/vendor/depot_tools/profile.xml +8 -0
- data/vendor/depot_tools/prpc +13 -0
- data/vendor/depot_tools/prpc.bat +8 -0
- data/vendor/depot_tools/pylint +9 -0
- data/vendor/depot_tools/pylint-1.5 +78 -0
- data/vendor/depot_tools/pylint-1.6 +78 -0
- data/vendor/depot_tools/pylint-1.7 +78 -0
- data/vendor/depot_tools/pylint-1.8 +78 -0
- data/vendor/depot_tools/pylint-1.9 +78 -0
- data/vendor/depot_tools/pylint.bat +12 -0
- data/vendor/depot_tools/pylint_main.py +45 -0
- data/vendor/depot_tools/pylintrc +349 -0
- data/vendor/depot_tools/python-bin/python3 +7 -0
- data/vendor/depot_tools/python_runner.sh +60 -0
- data/vendor/depot_tools/rdb +12 -0
- data/vendor/depot_tools/rdb.bat +7 -0
- data/vendor/depot_tools/recipes/OWNERS +4 -0
- data/vendor/depot_tools/recipes/README.recipes.md +1079 -0
- data/vendor/depot_tools/recipes/recipe_modules/OWNERS +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/OWNERS +2 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +38 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +516 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +117 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +117 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +118 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +194 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/input_commit_with_id_without_repo.json +210 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/multiple_patch_refs.json +214 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_branch_head.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_master.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/refs.json +212 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +210 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json +117 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +209 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +193 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +261 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +261 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +8 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +308 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/__init__.py +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +1258 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +93 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/do_not_retry_patch_failures_in_cq.py +42 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/ensure_checkout.py +35 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/__init__.py +9 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +455 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic_pkg.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +82 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-many-instances.json +411 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/mac64.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +315 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +313 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +313 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/win64.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.py +187 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py +59 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/test_api.py +93 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/__init__.py +9 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +75 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic_luci.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/win.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.py +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +13 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +428 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +462 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +238 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +240 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +238 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/resources/diff_deps.py +16 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/test_api.py +36 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/basic.json +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/dont have revision yet.json +84 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/no change, exception.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/windows.json +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.py +88 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +92 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/sync_failure.py +24 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/__init__.py +8 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +178 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +284 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +73 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/test_api.py +53 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +11 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/api.py +405 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +219 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +216 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +164 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +220 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +239 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +290 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +220 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +222 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +111 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +221 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +219 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.py +170 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/resources/git_setup.py +52 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/test_api.py +18 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/__init__.py +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +50 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/config.py +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +105 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.py +47 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/OWNERS +2 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/__init__.py +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +257 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +596 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.py +93 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +251 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/test_api.py +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.expected/basic.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.py +49 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/__init__.py +4 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/api.py +222 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.expected/basic.json +247 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.py +92 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/__init__.py +36 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/api.py +140 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/ancient_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/automatic_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/explicit_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/mac.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/win.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.py +42 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +27 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +251 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +27 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.py +19 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/properties.proto +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/test_api.py +19 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/execute.py +247 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/prepare.py +49 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +18 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +264 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json +57 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +190 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +190 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/test_api.py +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py +29 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.expected/basic.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py +32 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/__init__.py +25 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/api.py +137 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +108 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.py +21 -0
- data/vendor/depot_tools/recipes/recipes.py +249 -0
- data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +175 -0
- data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.py +56 -0
- data/vendor/depot_tools/recipes/trigger_recipe_roller.txt +13 -0
- data/vendor/depot_tools/repo +1194 -0
- data/vendor/depot_tools/roll-dep +21 -0
- data/vendor/depot_tools/roll-dep.bat +21 -0
- data/vendor/depot_tools/roll_dep.py +282 -0
- data/vendor/depot_tools/scm.py +415 -0
- data/vendor/depot_tools/setup_color.py +130 -0
- data/vendor/depot_tools/split_cl.py +263 -0
- data/vendor/depot_tools/subcommand.py +261 -0
- data/vendor/depot_tools/subprocess2.py +258 -0
- data/vendor/depot_tools/third_party/__init__.py +5 -0
- data/vendor/depot_tools/third_party/colorama/LICENSE.txt +27 -0
- data/vendor/depot_tools/third_party/colorama/README.chromium +12 -0
- data/vendor/depot_tools/third_party/colorama/README.rst +346 -0
- data/vendor/depot_tools/third_party/colorama/__init__.py +6 -0
- data/vendor/depot_tools/third_party/colorama/ansi.py +102 -0
- data/vendor/depot_tools/third_party/colorama/ansitowin32.py +257 -0
- data/vendor/depot_tools/third_party/colorama/initialise.py +80 -0
- data/vendor/depot_tools/third_party/colorama/win32.py +152 -0
- data/vendor/depot_tools/third_party/colorama/winterm.py +169 -0
- data/vendor/depot_tools/third_party/coverage/AUTHORS.txt +43 -0
- data/vendor/depot_tools/third_party/coverage/PKG-INFO +41 -0
- data/vendor/depot_tools/third_party/coverage/README.chromium +13 -0
- data/vendor/depot_tools/third_party/coverage/__init__.py +120 -0
- data/vendor/depot_tools/third_party/coverage/__main__.py +4 -0
- data/vendor/depot_tools/third_party/coverage/annotate.py +101 -0
- data/vendor/depot_tools/third_party/coverage/backward.py +184 -0
- data/vendor/depot_tools/third_party/coverage/bytecode.py +75 -0
- data/vendor/depot_tools/third_party/coverage/cmdline.py +740 -0
- data/vendor/depot_tools/third_party/coverage/codeunit.py +145 -0
- data/vendor/depot_tools/third_party/coverage/collector.py +353 -0
- data/vendor/depot_tools/third_party/coverage/config.py +213 -0
- data/vendor/depot_tools/third_party/coverage/control.py +776 -0
- data/vendor/depot_tools/third_party/coverage/data.py +278 -0
- data/vendor/depot_tools/third_party/coverage/debug.py +54 -0
- data/vendor/depot_tools/third_party/coverage/execfile.py +171 -0
- data/vendor/depot_tools/third_party/coverage/files.py +309 -0
- data/vendor/depot_tools/third_party/coverage/fullcoverage/encodings.py +57 -0
- data/vendor/depot_tools/third_party/coverage/html.py +387 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/coverage_html.js +376 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/index.html +104 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery-1.4.3.min.js +166 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.hotkeys.js +99 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.isonscreen.js +53 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.min.js +166 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.tablesorter.min.js +2 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/keybd_closed.png +0 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/keybd_open.png +0 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/pyfile.html +90 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/style.css +300 -0
- data/vendor/depot_tools/third_party/coverage/misc.py +163 -0
- data/vendor/depot_tools/third_party/coverage/parser.py +666 -0
- data/vendor/depot_tools/third_party/coverage/phystokens.py +208 -0
- data/vendor/depot_tools/third_party/coverage/report.py +92 -0
- data/vendor/depot_tools/third_party/coverage/results.py +286 -0
- data/vendor/depot_tools/third_party/coverage/summary.py +86 -0
- data/vendor/depot_tools/third_party/coverage/templite.py +166 -0
- data/vendor/depot_tools/third_party/coverage/version.py +9 -0
- data/vendor/depot_tools/third_party/coverage/xmlreport.py +155 -0
- data/vendor/depot_tools/third_party/httplib2/LICENSE +1339 -0
- data/vendor/depot_tools/third_party/httplib2/README.chromium +15 -0
- data/vendor/depot_tools/third_party/httplib2/__init__.py +1780 -0
- data/vendor/depot_tools/third_party/httplib2/cacerts.txt +2196 -0
- data/vendor/depot_tools/third_party/httplib2/iri2uri.py +110 -0
- data/vendor/depot_tools/third_party/httplib2/socks.py +448 -0
- data/vendor/depot_tools/third_party/repo/COPYING +202 -0
- data/vendor/depot_tools/third_party/repo/README.chromium +4 -0
- data/vendor/depot_tools/third_party/repo/__init__.py +0 -0
- data/vendor/depot_tools/third_party/repo/progress.py +117 -0
- data/vendor/depot_tools/third_party/retry_decorator/LICENSE.google +30 -0
- data/vendor/depot_tools/third_party/retry_decorator/__init__.py +0 -0
- data/vendor/depot_tools/third_party/retry_decorator/decorators.py +45 -0
- data/vendor/depot_tools/third_party/schema/.editorconfig +15 -0
- data/vendor/depot_tools/third_party/schema/.gitignore +174 -0
- data/vendor/depot_tools/third_party/schema/.travis.yml +37 -0
- data/vendor/depot_tools/third_party/schema/LICENSE-MIT +19 -0
- data/vendor/depot_tools/third_party/schema/MANIFEST.in +1 -0
- data/vendor/depot_tools/third_party/schema/README.chromium +12 -0
- data/vendor/depot_tools/third_party/schema/README.rst +382 -0
- data/vendor/depot_tools/third_party/schema/__init__.py +1 -0
- data/vendor/depot_tools/third_party/schema/schema.py +338 -0
- data/vendor/depot_tools/third_party/schema/setup.cfg +5 -0
- data/vendor/depot_tools/third_party/schema/setup.py +30 -0
- data/vendor/depot_tools/third_party/schema/test_schema.py +556 -0
- data/vendor/depot_tools/third_party/schema/tox.ini +33 -0
- data/vendor/depot_tools/third_party/six/LICENSE.txt +18 -0
- data/vendor/depot_tools/third_party/six/README.chromium +10 -0
- data/vendor/depot_tools/third_party/six/__init__.py +762 -0
- data/vendor/depot_tools/update_depot_tools +138 -0
- data/vendor/depot_tools/update_depot_tools.bat +65 -0
- data/vendor/depot_tools/update_depot_tools_toggle.py +38 -0
- data/vendor/depot_tools/upload_metrics.py +26 -0
- data/vendor/depot_tools/upload_to_google_storage.py +306 -0
- data/vendor/depot_tools/vpython +42 -0
- data/vendor/depot_tools/vpython.bat +7 -0
- data/vendor/depot_tools/vpython3 +55 -0
- data/vendor/depot_tools/vpython3.bat +12 -0
- data/vendor/depot_tools/watchlists.py +141 -0
- data/vendor/depot_tools/weekly +54 -0
- data/vendor/depot_tools/win32imports.py +61 -0
- data/vendor/depot_tools/win_toolchain/OWNERS +2 -0
- data/vendor/depot_tools/win_toolchain/README.md +74 -0
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +599 -0
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +524 -0
- data/vendor/depot_tools/wtf +81 -0
- data/vendor/depot_tools/yapf +21 -0
- data/vendor/depot_tools/yapf.bat +12 -0
- data/vendor/depot_tools/zsh-goodies/README +6 -0
- data/vendor/depot_tools/zsh-goodies/_gclient +14 -0
- metadata +729 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
# Copyright (c) 2016 The Chromium Authors. All rights reserved.
|
2
|
+
# Use of this source code is governed by a BSD-style license that can be
|
3
|
+
# found in the LICENSE file.
|
4
|
+
|
5
|
+
|
6
|
+
# This adds completion to bash shells for git cl commands. It is
|
7
|
+
# meant for developers and not needed for inclusion by any automated
|
8
|
+
# processes that will, of course, specify the full command, not rely
|
9
|
+
# on or benefit from tab-completion.
|
10
|
+
#
|
11
|
+
# Requires:
|
12
|
+
# Installed git bash completion.
|
13
|
+
#
|
14
|
+
# Usage:
|
15
|
+
# Put something like the following in your .bashrc:
|
16
|
+
# . $PATH_TO_DEPOT_TOOLS/git cl_completion.sh
|
17
|
+
#
|
18
|
+
|
19
|
+
|
20
|
+
# Parses commands from git cl -h.
|
21
|
+
__git_cl_commands () {
|
22
|
+
git cl -h 2> /dev/null | sed -n 's/^\s*\x1b\[32m\(\S\+\)\s*\x1b\[39m.*$/\1/p'
|
23
|
+
}
|
24
|
+
|
25
|
+
# Caches variables in __git_cl_all_commands.
|
26
|
+
__git_cl_compute_all_commands () {
|
27
|
+
test -n "$__git_cl_all_commands" ||
|
28
|
+
__git_cl_all_commands="$(__git_cl_commands)"
|
29
|
+
}
|
30
|
+
|
31
|
+
_git_cl () {
|
32
|
+
__git_cl_compute_all_commands
|
33
|
+
local subcommands=$(echo "$__git_cl_all_commands" | xargs)
|
34
|
+
local subcommand=$(__git_find_on_cmdline "$subcommands")
|
35
|
+
if [[ -z "$subcommand" ]]; then
|
36
|
+
__gitcomp "$subcommands"
|
37
|
+
return
|
38
|
+
fi
|
39
|
+
|
40
|
+
case "$subcommand,$cur" in
|
41
|
+
upload,--*)
|
42
|
+
__gitcomp_builtin cl_upload
|
43
|
+
;;
|
44
|
+
"",*)
|
45
|
+
__gitcomp_nl "${__git_cl_all_commands}"
|
46
|
+
;;
|
47
|
+
esac
|
48
|
+
}
|
@@ -0,0 +1,1101 @@
|
|
1
|
+
# Copyright 2014 The Chromium Authors. All rights reserved.
|
2
|
+
# Use of this source code is governed by a BSD-style license that can be
|
3
|
+
# found in the LICENSE file.
|
4
|
+
|
5
|
+
# Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
|
6
|
+
# Derived from https://gist.github.com/aljungberg/626518
|
7
|
+
|
8
|
+
from __future__ import print_function
|
9
|
+
from __future__ import unicode_literals
|
10
|
+
|
11
|
+
import multiprocessing.pool
|
12
|
+
import sys
|
13
|
+
import threading
|
14
|
+
|
15
|
+
from multiprocessing.pool import IMapIterator
|
16
|
+
|
17
|
+
def wrapper(func):
|
18
|
+
def wrap(self, timeout=None):
|
19
|
+
default_timeout = (1 << 31 if sys.version_info.major == 2 else
|
20
|
+
threading.TIMEOUT_MAX)
|
21
|
+
return func(self, timeout=timeout or default_timeout)
|
22
|
+
|
23
|
+
return wrap
|
24
|
+
IMapIterator.next = wrapper(IMapIterator.next)
|
25
|
+
IMapIterator.__next__ = IMapIterator.next
|
26
|
+
# TODO(iannucci): Monkeypatch all other 'wait' methods too.
|
27
|
+
|
28
|
+
|
29
|
+
import binascii
|
30
|
+
import collections
|
31
|
+
import contextlib
|
32
|
+
import functools
|
33
|
+
import logging
|
34
|
+
import os
|
35
|
+
import re
|
36
|
+
import setup_color
|
37
|
+
import shutil
|
38
|
+
import signal
|
39
|
+
import tempfile
|
40
|
+
import textwrap
|
41
|
+
|
42
|
+
import subprocess2
|
43
|
+
|
44
|
+
from io import BytesIO
|
45
|
+
|
46
|
+
|
47
|
+
if sys.version_info.major == 2:
|
48
|
+
# On Python 3, BrokenPipeError is raised instead.
|
49
|
+
BrokenPipeError = IOError
|
50
|
+
|
51
|
+
|
52
|
+
ROOT = os.path.abspath(os.path.dirname(__file__))
|
53
|
+
IS_WIN = sys.platform == 'win32'
|
54
|
+
TEST_MODE = False
|
55
|
+
|
56
|
+
|
57
|
+
def win_find_git():
|
58
|
+
for elem in os.environ.get('PATH', '').split(os.pathsep):
|
59
|
+
for candidate in ('git.exe', 'git.bat'):
|
60
|
+
path = os.path.join(elem, candidate)
|
61
|
+
if os.path.isfile(path):
|
62
|
+
return path
|
63
|
+
raise ValueError('Could not find Git on PATH.')
|
64
|
+
|
65
|
+
|
66
|
+
GIT_EXE = 'git' if not IS_WIN else win_find_git()
|
67
|
+
|
68
|
+
|
69
|
+
FREEZE = 'FREEZE'
|
70
|
+
FREEZE_SECTIONS = {
|
71
|
+
'indexed': 'soft',
|
72
|
+
'unindexed': 'mixed'
|
73
|
+
}
|
74
|
+
FREEZE_MATCHER = re.compile(r'%s.(%s)' % (FREEZE, '|'.join(FREEZE_SECTIONS)))
|
75
|
+
|
76
|
+
|
77
|
+
# NOTE: This list is DEPRECATED in favor of the Infra Git wrapper:
|
78
|
+
# https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/tools/git
|
79
|
+
#
|
80
|
+
# New entries should be added to the Git wrapper, NOT to this list. "git_retry"
|
81
|
+
# is, similarly, being deprecated in favor of the Git wrapper.
|
82
|
+
#
|
83
|
+
# ---
|
84
|
+
#
|
85
|
+
# Retry a git operation if git returns a error response with any of these
|
86
|
+
# messages. It's all observed 'bad' GoB responses so far.
|
87
|
+
#
|
88
|
+
# This list is inspired/derived from the one in ChromiumOS's Chromite:
|
89
|
+
# <CHROMITE>/lib/git.py::GIT_TRANSIENT_ERRORS
|
90
|
+
#
|
91
|
+
# It was last imported from '7add3ac29564d98ac35ce426bc295e743e7c0c02'.
|
92
|
+
GIT_TRANSIENT_ERRORS = (
|
93
|
+
# crbug.com/285832
|
94
|
+
r'!.*\[remote rejected\].*\(error in hook\)',
|
95
|
+
|
96
|
+
# crbug.com/289932
|
97
|
+
r'!.*\[remote rejected\].*\(failed to lock\)',
|
98
|
+
|
99
|
+
# crbug.com/307156
|
100
|
+
r'!.*\[remote rejected\].*\(error in Gerrit backend\)',
|
101
|
+
|
102
|
+
# crbug.com/285832
|
103
|
+
r'remote error: Internal Server Error',
|
104
|
+
|
105
|
+
# crbug.com/294449
|
106
|
+
r'fatal: Couldn\'t find remote ref ',
|
107
|
+
|
108
|
+
# crbug.com/220543
|
109
|
+
r'git fetch_pack: expected ACK/NAK, got',
|
110
|
+
|
111
|
+
# crbug.com/189455
|
112
|
+
r'protocol error: bad pack header',
|
113
|
+
|
114
|
+
# crbug.com/202807
|
115
|
+
r'The remote end hung up unexpectedly',
|
116
|
+
|
117
|
+
# crbug.com/298189
|
118
|
+
r'TLS packet with unexpected length was received',
|
119
|
+
|
120
|
+
# crbug.com/187444
|
121
|
+
r'RPC failed; result=\d+, HTTP code = \d+',
|
122
|
+
|
123
|
+
# crbug.com/388876
|
124
|
+
r'Connection timed out',
|
125
|
+
|
126
|
+
# crbug.com/430343
|
127
|
+
# TODO(dnj): Resync with Chromite.
|
128
|
+
r'The requested URL returned error: 5\d+',
|
129
|
+
|
130
|
+
r'Connection reset by peer',
|
131
|
+
|
132
|
+
r'Unable to look up',
|
133
|
+
|
134
|
+
r'Couldn\'t resolve host',
|
135
|
+
)
|
136
|
+
|
137
|
+
GIT_TRANSIENT_ERRORS_RE = re.compile('|'.join(GIT_TRANSIENT_ERRORS),
|
138
|
+
re.IGNORECASE)
|
139
|
+
|
140
|
+
# git's for-each-ref command first supported the upstream:track token in its
|
141
|
+
# format string in version 1.9.0, but some usages were broken until 2.3.0.
|
142
|
+
# See git commit b6160d95 for more information.
|
143
|
+
MIN_UPSTREAM_TRACK_GIT_VERSION = (2, 3)
|
144
|
+
|
145
|
+
class BadCommitRefException(Exception):
|
146
|
+
def __init__(self, refs):
|
147
|
+
msg = ('one of %s does not seem to be a valid commitref.' %
|
148
|
+
str(refs))
|
149
|
+
super(BadCommitRefException, self).__init__(msg)
|
150
|
+
|
151
|
+
|
152
|
+
def memoize_one(**kwargs):
|
153
|
+
"""Memoizes a single-argument pure function.
|
154
|
+
|
155
|
+
Values of None are not cached.
|
156
|
+
|
157
|
+
Kwargs:
|
158
|
+
threadsafe (bool) - REQUIRED. Specifies whether to use locking around
|
159
|
+
cache manipulation functions. This is a kwarg so that users of memoize_one
|
160
|
+
are forced to explicitly and verbosely pick True or False.
|
161
|
+
|
162
|
+
Adds three methods to the decorated function:
|
163
|
+
* get(key, default=None) - Gets the value for this key from the cache.
|
164
|
+
* set(key, value) - Sets the value for this key from the cache.
|
165
|
+
* clear() - Drops the entire contents of the cache. Useful for unittests.
|
166
|
+
* update(other) - Updates the contents of the cache from another dict.
|
167
|
+
"""
|
168
|
+
assert 'threadsafe' in kwargs, 'Must specify threadsafe={True,False}'
|
169
|
+
threadsafe = kwargs['threadsafe']
|
170
|
+
|
171
|
+
if threadsafe:
|
172
|
+
def withlock(lock, f):
|
173
|
+
def inner(*args, **kwargs):
|
174
|
+
with lock:
|
175
|
+
return f(*args, **kwargs)
|
176
|
+
return inner
|
177
|
+
else:
|
178
|
+
def withlock(_lock, f):
|
179
|
+
return f
|
180
|
+
|
181
|
+
def decorator(f):
|
182
|
+
# Instantiate the lock in decorator, in case users of memoize_one do:
|
183
|
+
#
|
184
|
+
# memoizer = memoize_one(threadsafe=True)
|
185
|
+
#
|
186
|
+
# @memoizer
|
187
|
+
# def fn1(val): ...
|
188
|
+
#
|
189
|
+
# @memoizer
|
190
|
+
# def fn2(val): ...
|
191
|
+
|
192
|
+
lock = threading.Lock() if threadsafe else None
|
193
|
+
cache = {}
|
194
|
+
_get = withlock(lock, cache.get)
|
195
|
+
_set = withlock(lock, cache.__setitem__)
|
196
|
+
|
197
|
+
@functools.wraps(f)
|
198
|
+
def inner(arg):
|
199
|
+
ret = _get(arg)
|
200
|
+
if ret is None:
|
201
|
+
ret = f(arg)
|
202
|
+
if ret is not None:
|
203
|
+
_set(arg, ret)
|
204
|
+
return ret
|
205
|
+
inner.get = _get
|
206
|
+
inner.set = _set
|
207
|
+
inner.clear = withlock(lock, cache.clear)
|
208
|
+
inner.update = withlock(lock, cache.update)
|
209
|
+
return inner
|
210
|
+
return decorator
|
211
|
+
|
212
|
+
|
213
|
+
def _ScopedPool_initer(orig, orig_args): # pragma: no cover
|
214
|
+
"""Initializer method for ScopedPool's subprocesses.
|
215
|
+
|
216
|
+
This helps ScopedPool handle Ctrl-C's correctly.
|
217
|
+
"""
|
218
|
+
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
219
|
+
if orig:
|
220
|
+
orig(*orig_args)
|
221
|
+
|
222
|
+
|
223
|
+
@contextlib.contextmanager
|
224
|
+
def ScopedPool(*args, **kwargs):
|
225
|
+
"""Context Manager which returns a multiprocessing.pool instance which
|
226
|
+
correctly deals with thrown exceptions.
|
227
|
+
|
228
|
+
*args - Arguments to multiprocessing.pool
|
229
|
+
|
230
|
+
Kwargs:
|
231
|
+
kind ('threads', 'procs') - The type of underlying coprocess to use.
|
232
|
+
**etc - Arguments to multiprocessing.pool
|
233
|
+
"""
|
234
|
+
if kwargs.pop('kind', None) == 'threads':
|
235
|
+
pool = multiprocessing.pool.ThreadPool(*args, **kwargs)
|
236
|
+
else:
|
237
|
+
orig, orig_args = kwargs.get('initializer'), kwargs.get('initargs', ())
|
238
|
+
kwargs['initializer'] = _ScopedPool_initer
|
239
|
+
kwargs['initargs'] = orig, orig_args
|
240
|
+
pool = multiprocessing.pool.Pool(*args, **kwargs)
|
241
|
+
|
242
|
+
try:
|
243
|
+
yield pool
|
244
|
+
pool.close()
|
245
|
+
except:
|
246
|
+
pool.terminate()
|
247
|
+
raise
|
248
|
+
finally:
|
249
|
+
pool.join()
|
250
|
+
|
251
|
+
|
252
|
+
class ProgressPrinter(object):
|
253
|
+
"""Threaded single-stat status message printer."""
|
254
|
+
def __init__(self, fmt, enabled=None, fout=sys.stderr, period=0.5):
|
255
|
+
"""Create a ProgressPrinter.
|
256
|
+
|
257
|
+
Use it as a context manager which produces a simple 'increment' method:
|
258
|
+
|
259
|
+
with ProgressPrinter('(%%(count)d/%d)' % 1000) as inc:
|
260
|
+
for i in xrange(1000):
|
261
|
+
# do stuff
|
262
|
+
if i % 10 == 0:
|
263
|
+
inc(10)
|
264
|
+
|
265
|
+
Args:
|
266
|
+
fmt - String format with a single '%(count)d' where the counter value
|
267
|
+
should go.
|
268
|
+
enabled (bool) - If this is None, will default to True if
|
269
|
+
logging.getLogger() is set to INFO or more verbose.
|
270
|
+
fout (file-like) - The stream to print status messages to.
|
271
|
+
period (float) - The time in seconds for the printer thread to wait
|
272
|
+
between printing.
|
273
|
+
"""
|
274
|
+
self.fmt = fmt
|
275
|
+
if enabled is None: # pragma: no cover
|
276
|
+
self.enabled = logging.getLogger().isEnabledFor(logging.INFO)
|
277
|
+
else:
|
278
|
+
self.enabled = enabled
|
279
|
+
|
280
|
+
self._count = 0
|
281
|
+
self._dead = False
|
282
|
+
self._dead_cond = threading.Condition()
|
283
|
+
self._stream = fout
|
284
|
+
self._thread = threading.Thread(target=self._run)
|
285
|
+
self._period = period
|
286
|
+
|
287
|
+
def _emit(self, s):
|
288
|
+
if self.enabled:
|
289
|
+
self._stream.write('\r' + s)
|
290
|
+
self._stream.flush()
|
291
|
+
|
292
|
+
def _run(self):
|
293
|
+
with self._dead_cond:
|
294
|
+
while not self._dead:
|
295
|
+
self._emit(self.fmt % {'count': self._count})
|
296
|
+
self._dead_cond.wait(self._period)
|
297
|
+
self._emit((self.fmt + '\n') % {'count': self._count})
|
298
|
+
|
299
|
+
def inc(self, amount=1):
|
300
|
+
self._count += amount
|
301
|
+
|
302
|
+
def __enter__(self):
|
303
|
+
self._thread.start()
|
304
|
+
return self.inc
|
305
|
+
|
306
|
+
def __exit__(self, _exc_type, _exc_value, _traceback):
|
307
|
+
self._dead = True
|
308
|
+
with self._dead_cond:
|
309
|
+
self._dead_cond.notifyAll()
|
310
|
+
self._thread.join()
|
311
|
+
del self._thread
|
312
|
+
|
313
|
+
|
314
|
+
def once(function):
|
315
|
+
"""@Decorates |function| so that it only performs its action once, no matter
|
316
|
+
how many times the decorated |function| is called."""
|
317
|
+
has_run = [False]
|
318
|
+
def _wrapper(*args, **kwargs):
|
319
|
+
if not has_run[0]:
|
320
|
+
has_run[0] = True
|
321
|
+
function(*args, **kwargs)
|
322
|
+
return _wrapper
|
323
|
+
|
324
|
+
|
325
|
+
def unicode_repr(s):
|
326
|
+
result = repr(s)
|
327
|
+
return result[1:] if result.startswith('u') else result
|
328
|
+
|
329
|
+
|
330
|
+
## Git functions
|
331
|
+
|
332
|
+
def die(message, *args):
|
333
|
+
print(textwrap.dedent(message % args), file=sys.stderr)
|
334
|
+
sys.exit(1)
|
335
|
+
|
336
|
+
|
337
|
+
def blame(filename, revision=None, porcelain=False, abbrev=None, *_args):
|
338
|
+
command = ['blame']
|
339
|
+
if porcelain:
|
340
|
+
command.append('-p')
|
341
|
+
if revision is not None:
|
342
|
+
command.append(revision)
|
343
|
+
if abbrev is not None:
|
344
|
+
command.append('--abbrev=%d' % abbrev)
|
345
|
+
command.extend(['--', filename])
|
346
|
+
return run(*command)
|
347
|
+
|
348
|
+
|
349
|
+
def branch_config(branch, option, default=None):
|
350
|
+
return get_config('branch.%s.%s' % (branch, option), default=default)
|
351
|
+
|
352
|
+
|
353
|
+
def branch_config_map(option):
|
354
|
+
"""Return {branch: <|option| value>} for all branches."""
|
355
|
+
try:
|
356
|
+
reg = re.compile(r'^branch\.(.*)\.%s$' % option)
|
357
|
+
lines = get_config_regexp(reg.pattern)
|
358
|
+
return {reg.match(k).group(1): v for k, v in (l.split() for l in lines)}
|
359
|
+
except subprocess2.CalledProcessError:
|
360
|
+
return {}
|
361
|
+
|
362
|
+
|
363
|
+
def branches(use_limit=True, *args):
|
364
|
+
NO_BRANCH = ('* (no branch', '* (detached', '* (HEAD detached')
|
365
|
+
|
366
|
+
key = 'depot-tools.branch-limit'
|
367
|
+
limit = get_config_int(key, 20)
|
368
|
+
|
369
|
+
raw_branches = run('branch', *args).splitlines()
|
370
|
+
|
371
|
+
num = len(raw_branches)
|
372
|
+
|
373
|
+
if use_limit and num > limit:
|
374
|
+
die("""\
|
375
|
+
Your git repo has too many branches (%d/%d) for this tool to work well.
|
376
|
+
|
377
|
+
You may adjust this limit by running:
|
378
|
+
git config %s <new_limit>
|
379
|
+
|
380
|
+
You may also try cleaning up your old branches by running:
|
381
|
+
git cl archive
|
382
|
+
""", num, limit, key)
|
383
|
+
|
384
|
+
for line in raw_branches:
|
385
|
+
if line.startswith(NO_BRANCH):
|
386
|
+
continue
|
387
|
+
yield line.split()[-1]
|
388
|
+
|
389
|
+
|
390
|
+
def get_config(option, default=None):
|
391
|
+
try:
|
392
|
+
return run('config', '--get', option) or default
|
393
|
+
except subprocess2.CalledProcessError:
|
394
|
+
return default
|
395
|
+
|
396
|
+
|
397
|
+
def get_config_int(option, default=0):
|
398
|
+
assert isinstance(default, int)
|
399
|
+
try:
|
400
|
+
return int(get_config(option, default))
|
401
|
+
except ValueError:
|
402
|
+
return default
|
403
|
+
|
404
|
+
|
405
|
+
def get_config_list(option):
|
406
|
+
try:
|
407
|
+
return run('config', '--get-all', option).split()
|
408
|
+
except subprocess2.CalledProcessError:
|
409
|
+
return []
|
410
|
+
|
411
|
+
|
412
|
+
def get_config_regexp(pattern):
|
413
|
+
if IS_WIN: # pragma: no cover
|
414
|
+
# this madness is because we call git.bat which calls git.exe which calls
|
415
|
+
# bash.exe (or something to that effect). Each layer divides the number of
|
416
|
+
# ^'s by 2.
|
417
|
+
pattern = pattern.replace('^', '^' * 8)
|
418
|
+
return run('config', '--get-regexp', pattern).splitlines()
|
419
|
+
|
420
|
+
|
421
|
+
def current_branch():
|
422
|
+
try:
|
423
|
+
return run('rev-parse', '--abbrev-ref', 'HEAD')
|
424
|
+
except subprocess2.CalledProcessError:
|
425
|
+
return None
|
426
|
+
|
427
|
+
|
428
|
+
def del_branch_config(branch, option, scope='local'):
|
429
|
+
del_config('branch.%s.%s' % (branch, option), scope=scope)
|
430
|
+
|
431
|
+
|
432
|
+
def del_config(option, scope='local'):
|
433
|
+
try:
|
434
|
+
run('config', '--' + scope, '--unset', option)
|
435
|
+
except subprocess2.CalledProcessError:
|
436
|
+
pass
|
437
|
+
|
438
|
+
|
439
|
+
def diff(oldrev, newrev, *args):
|
440
|
+
return run('diff', oldrev, newrev, *args)
|
441
|
+
|
442
|
+
|
443
|
+
def freeze():
|
444
|
+
took_action = False
|
445
|
+
key = 'depot-tools.freeze-size-limit'
|
446
|
+
MB = 2**20
|
447
|
+
limit_mb = get_config_int(key, 100)
|
448
|
+
untracked_bytes = 0
|
449
|
+
|
450
|
+
root_path = repo_root()
|
451
|
+
|
452
|
+
for f, s in status():
|
453
|
+
if is_unmerged(s):
|
454
|
+
die("Cannot freeze unmerged changes!")
|
455
|
+
if limit_mb > 0:
|
456
|
+
if s.lstat == '?':
|
457
|
+
untracked_bytes += os.lstat(os.path.join(root_path, f)).st_size
|
458
|
+
if limit_mb > 0 and untracked_bytes > limit_mb * MB:
|
459
|
+
die("""\
|
460
|
+
You appear to have too much untracked+unignored data in your git
|
461
|
+
checkout: %.1f / %d MB.
|
462
|
+
|
463
|
+
Run `git status` to see what it is.
|
464
|
+
|
465
|
+
In addition to making many git commands slower, this will prevent
|
466
|
+
depot_tools from freezing your in-progress changes.
|
467
|
+
|
468
|
+
You should add untracked data that you want to ignore to your repo's
|
469
|
+
.git/info/exclude
|
470
|
+
file. See `git help ignore` for the format of this file.
|
471
|
+
|
472
|
+
If this data is intended as part of your commit, you may adjust the
|
473
|
+
freeze limit by running:
|
474
|
+
git config %s <new_limit>
|
475
|
+
Where <new_limit> is an integer threshold in megabytes.""",
|
476
|
+
untracked_bytes / (MB * 1.0), limit_mb, key)
|
477
|
+
|
478
|
+
try:
|
479
|
+
run('commit', '--no-verify', '-m', FREEZE + '.indexed')
|
480
|
+
took_action = True
|
481
|
+
except subprocess2.CalledProcessError:
|
482
|
+
pass
|
483
|
+
|
484
|
+
add_errors = False
|
485
|
+
try:
|
486
|
+
run('add', '-A', '--ignore-errors')
|
487
|
+
except subprocess2.CalledProcessError:
|
488
|
+
add_errors = True
|
489
|
+
|
490
|
+
try:
|
491
|
+
run('commit', '--no-verify', '-m', FREEZE + '.unindexed')
|
492
|
+
took_action = True
|
493
|
+
except subprocess2.CalledProcessError:
|
494
|
+
pass
|
495
|
+
|
496
|
+
ret = []
|
497
|
+
if add_errors:
|
498
|
+
ret.append('Failed to index some unindexed files.')
|
499
|
+
if not took_action:
|
500
|
+
ret.append('Nothing to freeze.')
|
501
|
+
return ' '.join(ret) or None
|
502
|
+
|
503
|
+
|
504
|
+
def get_branch_tree():
|
505
|
+
"""Get the dictionary of {branch: parent}, compatible with topo_iter.
|
506
|
+
|
507
|
+
Returns a tuple of (skipped, <branch_tree dict>) where skipped is a set of
|
508
|
+
branches without upstream branches defined.
|
509
|
+
"""
|
510
|
+
skipped = set()
|
511
|
+
branch_tree = {}
|
512
|
+
|
513
|
+
for branch in branches():
|
514
|
+
parent = upstream(branch)
|
515
|
+
if not parent:
|
516
|
+
skipped.add(branch)
|
517
|
+
continue
|
518
|
+
branch_tree[branch] = parent
|
519
|
+
|
520
|
+
return skipped, branch_tree
|
521
|
+
|
522
|
+
|
523
|
+
def get_or_create_merge_base(branch, parent=None):
|
524
|
+
"""Finds the configured merge base for branch.
|
525
|
+
|
526
|
+
If parent is supplied, it's used instead of calling upstream(branch).
|
527
|
+
"""
|
528
|
+
base = branch_config(branch, 'base')
|
529
|
+
base_upstream = branch_config(branch, 'base-upstream')
|
530
|
+
parent = parent or upstream(branch)
|
531
|
+
if parent is None or branch is None:
|
532
|
+
return None
|
533
|
+
actual_merge_base = run('merge-base', parent, branch)
|
534
|
+
|
535
|
+
if base_upstream != parent:
|
536
|
+
base = None
|
537
|
+
base_upstream = None
|
538
|
+
|
539
|
+
def is_ancestor(a, b):
|
540
|
+
return run_with_retcode('merge-base', '--is-ancestor', a, b) == 0
|
541
|
+
|
542
|
+
if base and base != actual_merge_base:
|
543
|
+
if not is_ancestor(base, branch):
|
544
|
+
logging.debug('Found WRONG pre-set merge-base for %s: %s', branch, base)
|
545
|
+
base = None
|
546
|
+
elif is_ancestor(base, actual_merge_base):
|
547
|
+
logging.debug('Found OLD pre-set merge-base for %s: %s', branch, base)
|
548
|
+
base = None
|
549
|
+
else:
|
550
|
+
logging.debug('Found pre-set merge-base for %s: %s', branch, base)
|
551
|
+
|
552
|
+
if not base:
|
553
|
+
base = actual_merge_base
|
554
|
+
manual_merge_base(branch, base, parent)
|
555
|
+
|
556
|
+
return base
|
557
|
+
|
558
|
+
|
559
|
+
def hash_multi(*reflike):
|
560
|
+
return run('rev-parse', *reflike).splitlines()
|
561
|
+
|
562
|
+
|
563
|
+
def hash_one(reflike, short=False):
|
564
|
+
args = ['rev-parse', reflike]
|
565
|
+
if short:
|
566
|
+
args.insert(1, '--short')
|
567
|
+
return run(*args)
|
568
|
+
|
569
|
+
|
570
|
+
def in_rebase():
|
571
|
+
git_dir = run('rev-parse', '--git-dir')
|
572
|
+
return (
|
573
|
+
os.path.exists(os.path.join(git_dir, 'rebase-merge')) or
|
574
|
+
os.path.exists(os.path.join(git_dir, 'rebase-apply')))
|
575
|
+
|
576
|
+
|
577
|
+
def intern_f(f, kind='blob'):
|
578
|
+
"""Interns a file object into the git object store.
|
579
|
+
|
580
|
+
Args:
|
581
|
+
f (file-like object) - The file-like object to intern
|
582
|
+
kind (git object type) - One of 'blob', 'commit', 'tree', 'tag'.
|
583
|
+
|
584
|
+
Returns the git hash of the interned object (hex encoded).
|
585
|
+
"""
|
586
|
+
ret = run('hash-object', '-t', kind, '-w', '--stdin', stdin=f)
|
587
|
+
f.close()
|
588
|
+
return ret
|
589
|
+
|
590
|
+
|
591
|
+
def is_dormant(branch):
|
592
|
+
# TODO(iannucci): Do an oldness check?
|
593
|
+
return branch_config(branch, 'dormant', 'false') != 'false'
|
594
|
+
|
595
|
+
|
596
|
+
def is_unmerged(stat_value):
|
597
|
+
return (
|
598
|
+
'U' in (stat_value.lstat, stat_value.rstat) or
|
599
|
+
((stat_value.lstat == stat_value.rstat) and stat_value.lstat in 'AD')
|
600
|
+
)
|
601
|
+
|
602
|
+
|
603
|
+
def manual_merge_base(branch, base, parent):
|
604
|
+
set_branch_config(branch, 'base', base)
|
605
|
+
set_branch_config(branch, 'base-upstream', parent)
|
606
|
+
|
607
|
+
|
608
|
+
def mktree(treedict):
|
609
|
+
"""Makes a git tree object and returns its hash.
|
610
|
+
|
611
|
+
See |tree()| for the values of mode, type, and ref.
|
612
|
+
|
613
|
+
Args:
|
614
|
+
treedict - { name: (mode, type, ref) }
|
615
|
+
"""
|
616
|
+
with tempfile.TemporaryFile() as f:
|
617
|
+
for name, (mode, typ, ref) in treedict.items():
|
618
|
+
f.write(('%s %s %s\t%s\0' % (mode, typ, ref, name)).encode('utf-8'))
|
619
|
+
f.seek(0)
|
620
|
+
return run('mktree', '-z', stdin=f)
|
621
|
+
|
622
|
+
|
623
|
+
def parse_commitrefs(*commitrefs):
|
624
|
+
"""Returns binary encoded commit hashes for one or more commitrefs.
|
625
|
+
|
626
|
+
A commitref is anything which can resolve to a commit. Popular examples:
|
627
|
+
* 'HEAD'
|
628
|
+
* 'origin/master'
|
629
|
+
* 'cool_branch~2'
|
630
|
+
"""
|
631
|
+
try:
|
632
|
+
return [binascii.unhexlify(h) for h in hash_multi(*commitrefs)]
|
633
|
+
except subprocess2.CalledProcessError:
|
634
|
+
raise BadCommitRefException(commitrefs)
|
635
|
+
|
636
|
+
|
637
|
+
RebaseRet = collections.namedtuple('RebaseRet', 'success stdout stderr')
|
638
|
+
|
639
|
+
|
640
|
+
def rebase(parent, start, branch, abort=False):
|
641
|
+
"""Rebases |start|..|branch| onto the branch |parent|.
|
642
|
+
|
643
|
+
Args:
|
644
|
+
parent - The new parent ref for the rebased commits.
|
645
|
+
start - The commit to start from
|
646
|
+
branch - The branch to rebase
|
647
|
+
abort - If True, will call git-rebase --abort in the event that the rebase
|
648
|
+
doesn't complete successfully.
|
649
|
+
|
650
|
+
Returns a namedtuple with fields:
|
651
|
+
success - a boolean indicating that the rebase command completed
|
652
|
+
successfully.
|
653
|
+
message - if the rebase failed, this contains the stdout of the failed
|
654
|
+
rebase.
|
655
|
+
"""
|
656
|
+
try:
|
657
|
+
args = ['--onto', parent, start, branch]
|
658
|
+
if TEST_MODE:
|
659
|
+
args.insert(0, '--committer-date-is-author-date')
|
660
|
+
run('rebase', *args)
|
661
|
+
return RebaseRet(True, '', '')
|
662
|
+
except subprocess2.CalledProcessError as cpe:
|
663
|
+
if abort:
|
664
|
+
run_with_retcode('rebase', '--abort') # ignore failure
|
665
|
+
return RebaseRet(False, cpe.stdout.decode('utf-8', 'replace'),
|
666
|
+
cpe.stderr.decode('utf-8', 'replace'))
|
667
|
+
|
668
|
+
|
669
|
+
def remove_merge_base(branch):
|
670
|
+
del_branch_config(branch, 'base')
|
671
|
+
del_branch_config(branch, 'base-upstream')
|
672
|
+
|
673
|
+
|
674
|
+
def repo_root():
|
675
|
+
"""Returns the absolute path to the repository root."""
|
676
|
+
return run('rev-parse', '--show-toplevel')
|
677
|
+
|
678
|
+
|
679
|
+
def upstream_default():
|
680
|
+
"""Returns the default branch name of the origin repository."""
|
681
|
+
try:
|
682
|
+
return run('rev-parse', '--abbrev-ref', 'origin/HEAD')
|
683
|
+
except subprocess2.CalledProcessError:
|
684
|
+
return 'origin/master'
|
685
|
+
|
686
|
+
|
687
|
+
def root():
|
688
|
+
return get_config('depot-tools.upstream', upstream_default())
|
689
|
+
|
690
|
+
|
691
|
+
@contextlib.contextmanager
|
692
|
+
def less(): # pragma: no cover
|
693
|
+
"""Runs 'less' as context manager yielding its stdin as a PIPE.
|
694
|
+
|
695
|
+
Automatically checks if sys.stdout is a non-TTY stream. If so, it avoids
|
696
|
+
running less and just yields sys.stdout.
|
697
|
+
|
698
|
+
The returned PIPE is opened on binary mode.
|
699
|
+
"""
|
700
|
+
if not setup_color.IS_TTY:
|
701
|
+
# On Python 3, sys.stdout doesn't accept bytes, and sys.stdout.buffer must
|
702
|
+
# be used.
|
703
|
+
yield getattr(sys.stdout, 'buffer', sys.stdout)
|
704
|
+
return
|
705
|
+
|
706
|
+
# Run with the same options that git uses (see setup_pager in git repo).
|
707
|
+
# -F: Automatically quit if the output is less than one screen.
|
708
|
+
# -R: Don't escape ANSI color codes.
|
709
|
+
# -X: Don't clear the screen before starting.
|
710
|
+
cmd = ('less', '-FRX')
|
711
|
+
try:
|
712
|
+
proc = subprocess2.Popen(cmd, stdin=subprocess2.PIPE)
|
713
|
+
yield proc.stdin
|
714
|
+
finally:
|
715
|
+
try:
|
716
|
+
proc.stdin.close()
|
717
|
+
except BrokenPipeError:
|
718
|
+
# BrokenPipeError is raised if proc has already completed,
|
719
|
+
pass
|
720
|
+
proc.wait()
|
721
|
+
|
722
|
+
|
723
|
+
def run(*cmd, **kwargs):
|
724
|
+
"""The same as run_with_stderr, except it only returns stdout."""
|
725
|
+
return run_with_stderr(*cmd, **kwargs)[0]
|
726
|
+
|
727
|
+
|
728
|
+
def run_with_retcode(*cmd, **kwargs):
|
729
|
+
"""Run a command but only return the status code."""
|
730
|
+
try:
|
731
|
+
run(*cmd, **kwargs)
|
732
|
+
return 0
|
733
|
+
except subprocess2.CalledProcessError as cpe:
|
734
|
+
return cpe.returncode
|
735
|
+
|
736
|
+
def run_stream(*cmd, **kwargs):
|
737
|
+
"""Runs a git command. Returns stdout as a PIPE (file-like object).
|
738
|
+
|
739
|
+
stderr is dropped to avoid races if the process outputs to both stdout and
|
740
|
+
stderr.
|
741
|
+
"""
|
742
|
+
kwargs.setdefault('stderr', subprocess2.VOID)
|
743
|
+
kwargs.setdefault('stdout', subprocess2.PIPE)
|
744
|
+
kwargs.setdefault('shell', False)
|
745
|
+
cmd = (GIT_EXE, '-c', 'color.ui=never') + cmd
|
746
|
+
proc = subprocess2.Popen(cmd, **kwargs)
|
747
|
+
return proc.stdout
|
748
|
+
|
749
|
+
|
750
|
+
@contextlib.contextmanager
|
751
|
+
def run_stream_with_retcode(*cmd, **kwargs):
|
752
|
+
"""Runs a git command as context manager yielding stdout as a PIPE.
|
753
|
+
|
754
|
+
stderr is dropped to avoid races if the process outputs to both stdout and
|
755
|
+
stderr.
|
756
|
+
|
757
|
+
Raises subprocess2.CalledProcessError on nonzero return code.
|
758
|
+
"""
|
759
|
+
kwargs.setdefault('stderr', subprocess2.VOID)
|
760
|
+
kwargs.setdefault('stdout', subprocess2.PIPE)
|
761
|
+
kwargs.setdefault('shell', False)
|
762
|
+
cmd = (GIT_EXE, '-c', 'color.ui=never') + cmd
|
763
|
+
try:
|
764
|
+
proc = subprocess2.Popen(cmd, **kwargs)
|
765
|
+
yield proc.stdout
|
766
|
+
finally:
|
767
|
+
retcode = proc.wait()
|
768
|
+
if retcode != 0:
|
769
|
+
raise subprocess2.CalledProcessError(retcode, cmd, os.getcwd(),
|
770
|
+
b'', b'')
|
771
|
+
|
772
|
+
|
773
|
+
def run_with_stderr(*cmd, **kwargs):
|
774
|
+
"""Runs a git command.
|
775
|
+
|
776
|
+
Returns (stdout, stderr) as a pair of strings.
|
777
|
+
|
778
|
+
kwargs
|
779
|
+
autostrip (bool) - Strip the output. Defaults to True.
|
780
|
+
indata (str) - Specifies stdin data for the process.
|
781
|
+
"""
|
782
|
+
kwargs.setdefault('stdin', subprocess2.PIPE)
|
783
|
+
kwargs.setdefault('stdout', subprocess2.PIPE)
|
784
|
+
kwargs.setdefault('stderr', subprocess2.PIPE)
|
785
|
+
kwargs.setdefault('shell', False)
|
786
|
+
autostrip = kwargs.pop('autostrip', True)
|
787
|
+
indata = kwargs.pop('indata', None)
|
788
|
+
decode = kwargs.pop('decode', True)
|
789
|
+
|
790
|
+
cmd = (GIT_EXE, '-c', 'color.ui=never') + cmd
|
791
|
+
proc = subprocess2.Popen(cmd, **kwargs)
|
792
|
+
ret, err = proc.communicate(indata)
|
793
|
+
retcode = proc.wait()
|
794
|
+
if retcode != 0:
|
795
|
+
raise subprocess2.CalledProcessError(retcode, cmd, os.getcwd(), ret, err)
|
796
|
+
|
797
|
+
if autostrip:
|
798
|
+
ret = (ret or b'').strip()
|
799
|
+
err = (err or b'').strip()
|
800
|
+
|
801
|
+
if decode:
|
802
|
+
ret = ret.decode('utf-8', 'replace')
|
803
|
+
err = err.decode('utf-8', 'replace')
|
804
|
+
|
805
|
+
return ret, err
|
806
|
+
|
807
|
+
|
808
|
+
def set_branch_config(branch, option, value, scope='local'):
|
809
|
+
set_config('branch.%s.%s' % (branch, option), value, scope=scope)
|
810
|
+
|
811
|
+
|
812
|
+
def set_config(option, value, scope='local'):
|
813
|
+
run('config', '--' + scope, option, value)
|
814
|
+
|
815
|
+
|
816
|
+
def get_dirty_files():
|
817
|
+
# Make sure index is up-to-date before running diff-index.
|
818
|
+
run_with_retcode('update-index', '--refresh', '-q')
|
819
|
+
return run('diff-index', '--ignore-submodules', '--name-status', 'HEAD')
|
820
|
+
|
821
|
+
|
822
|
+
def is_dirty_git_tree(cmd):
|
823
|
+
w = lambda s: sys.stderr.write(s+"\n")
|
824
|
+
|
825
|
+
dirty = get_dirty_files()
|
826
|
+
if dirty:
|
827
|
+
w('Cannot %s with a dirty tree. Commit, freeze or stash your changes first.'
|
828
|
+
% cmd)
|
829
|
+
w('Uncommitted files: (git diff-index --name-status HEAD)')
|
830
|
+
w(dirty[:4096])
|
831
|
+
if len(dirty) > 4096: # pragma: no cover
|
832
|
+
w('... (run "git diff-index --name-status HEAD" to see full output).')
|
833
|
+
return True
|
834
|
+
return False
|
835
|
+
|
836
|
+
|
837
|
+
def status():
|
838
|
+
"""Returns a parsed version of git-status.
|
839
|
+
|
840
|
+
Returns a generator of (current_name, (lstat, rstat, src)) pairs where:
|
841
|
+
* current_name is the name of the file
|
842
|
+
* lstat is the left status code letter from git-status
|
843
|
+
* rstat is the left status code letter from git-status
|
844
|
+
* src is the current name of the file, or the original name of the file
|
845
|
+
if lstat == 'R'
|
846
|
+
"""
|
847
|
+
stat_entry = collections.namedtuple('stat_entry', 'lstat rstat src')
|
848
|
+
|
849
|
+
def tokenizer(stream):
|
850
|
+
acc = BytesIO()
|
851
|
+
c = None
|
852
|
+
while c != b'':
|
853
|
+
c = stream.read(1)
|
854
|
+
if c in (None, b'', b'\0'):
|
855
|
+
if len(acc.getvalue()):
|
856
|
+
yield acc.getvalue()
|
857
|
+
acc = BytesIO()
|
858
|
+
else:
|
859
|
+
acc.write(c)
|
860
|
+
|
861
|
+
def parser(tokens):
|
862
|
+
while True:
|
863
|
+
try:
|
864
|
+
status_dest = next(tokens).decode('utf-8')
|
865
|
+
except StopIteration:
|
866
|
+
return
|
867
|
+
stat, dest = status_dest[:2], status_dest[3:]
|
868
|
+
lstat, rstat = stat
|
869
|
+
if lstat == 'R':
|
870
|
+
src = next(tokens).decode('utf-8')
|
871
|
+
else:
|
872
|
+
src = dest
|
873
|
+
yield (dest, stat_entry(lstat, rstat, src))
|
874
|
+
|
875
|
+
return parser(tokenizer(run_stream('status', '-z', bufsize=-1)))
|
876
|
+
|
877
|
+
|
878
|
+
def squash_current_branch(header=None, merge_base=None):
|
879
|
+
header = header or 'git squash commit for %s.' % current_branch()
|
880
|
+
merge_base = merge_base or get_or_create_merge_base(current_branch())
|
881
|
+
log_msg = header + '\n'
|
882
|
+
if log_msg:
|
883
|
+
log_msg += '\n'
|
884
|
+
log_msg += run('log', '--reverse', '--format=%H%n%B', '%s..HEAD' % merge_base)
|
885
|
+
run('reset', '--soft', merge_base)
|
886
|
+
|
887
|
+
if not get_dirty_files():
|
888
|
+
# Sometimes the squash can result in the same tree, meaning that there is
|
889
|
+
# nothing to commit at this point.
|
890
|
+
print('Nothing to commit; squashed branch is empty')
|
891
|
+
return False
|
892
|
+
run('commit', '--no-verify', '-a', '-F', '-', indata=log_msg.encode('utf-8'))
|
893
|
+
return True
|
894
|
+
|
895
|
+
|
896
|
+
def tags(*args):
|
897
|
+
return run('tag', *args).splitlines()
|
898
|
+
|
899
|
+
|
900
|
+
def thaw():
|
901
|
+
took_action = False
|
902
|
+
for sha in run_stream('rev-list', 'HEAD').readlines():
|
903
|
+
sha = sha.strip().decode('utf-8')
|
904
|
+
msg = run('show', '--format=%f%b', '-s', 'HEAD')
|
905
|
+
match = FREEZE_MATCHER.match(msg)
|
906
|
+
if not match:
|
907
|
+
if not took_action:
|
908
|
+
return 'Nothing to thaw.'
|
909
|
+
break
|
910
|
+
|
911
|
+
run('reset', '--' + FREEZE_SECTIONS[match.group(1)], sha)
|
912
|
+
took_action = True
|
913
|
+
|
914
|
+
|
915
|
+
def topo_iter(branch_tree, top_down=True):
|
916
|
+
"""Generates (branch, parent) in topographical order for a branch tree.
|
917
|
+
|
918
|
+
Given a tree:
|
919
|
+
|
920
|
+
A1
|
921
|
+
B1 B2
|
922
|
+
C1 C2 C3
|
923
|
+
D1
|
924
|
+
|
925
|
+
branch_tree would look like: {
|
926
|
+
'D1': 'C3',
|
927
|
+
'C3': 'B2',
|
928
|
+
'B2': 'A1',
|
929
|
+
'C1': 'B1',
|
930
|
+
'C2': 'B1',
|
931
|
+
'B1': 'A1',
|
932
|
+
}
|
933
|
+
|
934
|
+
It is OK to have multiple 'root' nodes in your graph.
|
935
|
+
|
936
|
+
if top_down is True, items are yielded from A->D. Otherwise they're yielded
|
937
|
+
from D->A. Within a layer the branches will be yielded in sorted order.
|
938
|
+
"""
|
939
|
+
branch_tree = branch_tree.copy()
|
940
|
+
|
941
|
+
# TODO(iannucci): There is probably a more efficient way to do these.
|
942
|
+
if top_down:
|
943
|
+
while branch_tree:
|
944
|
+
this_pass = [(b, p) for b, p in branch_tree.items()
|
945
|
+
if p not in branch_tree]
|
946
|
+
assert this_pass, "Branch tree has cycles: %r" % branch_tree
|
947
|
+
for branch, parent in sorted(this_pass):
|
948
|
+
yield branch, parent
|
949
|
+
del branch_tree[branch]
|
950
|
+
else:
|
951
|
+
parent_to_branches = collections.defaultdict(set)
|
952
|
+
for branch, parent in branch_tree.items():
|
953
|
+
parent_to_branches[parent].add(branch)
|
954
|
+
|
955
|
+
while branch_tree:
|
956
|
+
this_pass = [(b, p) for b, p in branch_tree.items()
|
957
|
+
if not parent_to_branches[b]]
|
958
|
+
assert this_pass, "Branch tree has cycles: %r" % branch_tree
|
959
|
+
for branch, parent in sorted(this_pass):
|
960
|
+
yield branch, parent
|
961
|
+
parent_to_branches[parent].discard(branch)
|
962
|
+
del branch_tree[branch]
|
963
|
+
|
964
|
+
|
965
|
+
def tree(treeref, recurse=False):
|
966
|
+
"""Returns a dict representation of a git tree object.
|
967
|
+
|
968
|
+
Args:
|
969
|
+
treeref (str) - a git ref which resolves to a tree (commits count as trees).
|
970
|
+
recurse (bool) - include all of the tree's descendants too. File names will
|
971
|
+
take the form of 'some/path/to/file'.
|
972
|
+
|
973
|
+
Return format:
|
974
|
+
{ 'file_name': (mode, type, ref) }
|
975
|
+
|
976
|
+
mode is an integer where:
|
977
|
+
* 0040000 - Directory
|
978
|
+
* 0100644 - Regular non-executable file
|
979
|
+
* 0100664 - Regular non-executable group-writeable file
|
980
|
+
* 0100755 - Regular executable file
|
981
|
+
* 0120000 - Symbolic link
|
982
|
+
* 0160000 - Gitlink
|
983
|
+
|
984
|
+
type is a string where it's one of 'blob', 'commit', 'tree', 'tag'.
|
985
|
+
|
986
|
+
ref is the hex encoded hash of the entry.
|
987
|
+
"""
|
988
|
+
ret = {}
|
989
|
+
opts = ['ls-tree', '--full-tree']
|
990
|
+
if recurse:
|
991
|
+
opts.append('-r')
|
992
|
+
opts.append(treeref)
|
993
|
+
try:
|
994
|
+
for line in run(*opts).splitlines():
|
995
|
+
mode, typ, ref, name = line.split(None, 3)
|
996
|
+
ret[name] = (mode, typ, ref)
|
997
|
+
except subprocess2.CalledProcessError:
|
998
|
+
return None
|
999
|
+
return ret
|
1000
|
+
|
1001
|
+
|
1002
|
+
def get_remote_url(remote='origin'):
|
1003
|
+
try:
|
1004
|
+
return run('config', 'remote.%s.url' % remote)
|
1005
|
+
except subprocess2.CalledProcessError:
|
1006
|
+
return None
|
1007
|
+
|
1008
|
+
|
1009
|
+
def upstream(branch):
|
1010
|
+
try:
|
1011
|
+
return run('rev-parse', '--abbrev-ref', '--symbolic-full-name',
|
1012
|
+
branch+'@{upstream}')
|
1013
|
+
except subprocess2.CalledProcessError:
|
1014
|
+
return None
|
1015
|
+
|
1016
|
+
|
1017
|
+
def get_git_version():
|
1018
|
+
"""Returns a tuple that contains the numeric components of the current git
|
1019
|
+
version."""
|
1020
|
+
version_string = run('--version')
|
1021
|
+
version_match = re.search(r'(\d+.)+(\d+)', version_string)
|
1022
|
+
version = version_match.group() if version_match else ''
|
1023
|
+
|
1024
|
+
return tuple(int(x) for x in version.split('.'))
|
1025
|
+
|
1026
|
+
|
1027
|
+
def get_branches_info(include_tracking_status):
|
1028
|
+
format_string = (
|
1029
|
+
'--format=%(refname:short):%(objectname:short):%(upstream:short):')
|
1030
|
+
|
1031
|
+
# This is not covered by the depot_tools CQ which only has git version 1.8.
|
1032
|
+
if (include_tracking_status and
|
1033
|
+
get_git_version() >= MIN_UPSTREAM_TRACK_GIT_VERSION): # pragma: no cover
|
1034
|
+
format_string += '%(upstream:track)'
|
1035
|
+
|
1036
|
+
info_map = {}
|
1037
|
+
data = run('for-each-ref', format_string, 'refs/heads')
|
1038
|
+
BranchesInfo = collections.namedtuple(
|
1039
|
+
'BranchesInfo', 'hash upstream ahead behind')
|
1040
|
+
for line in data.splitlines():
|
1041
|
+
(branch, branch_hash, upstream_branch, tracking_status) = line.split(':')
|
1042
|
+
|
1043
|
+
ahead_match = re.search(r'ahead (\d+)', tracking_status)
|
1044
|
+
ahead = int(ahead_match.group(1)) if ahead_match else None
|
1045
|
+
|
1046
|
+
behind_match = re.search(r'behind (\d+)', tracking_status)
|
1047
|
+
behind = int(behind_match.group(1)) if behind_match else None
|
1048
|
+
|
1049
|
+
info_map[branch] = BranchesInfo(
|
1050
|
+
hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind)
|
1051
|
+
|
1052
|
+
# Set None for upstreams which are not branches (e.g empty upstream, remotes
|
1053
|
+
# and deleted upstream branches).
|
1054
|
+
missing_upstreams = {}
|
1055
|
+
for info in info_map.values():
|
1056
|
+
if info.upstream not in info_map and info.upstream not in missing_upstreams:
|
1057
|
+
missing_upstreams[info.upstream] = None
|
1058
|
+
|
1059
|
+
result = info_map.copy()
|
1060
|
+
result.update(missing_upstreams)
|
1061
|
+
return result
|
1062
|
+
|
1063
|
+
|
1064
|
+
def make_workdir_common(repository, new_workdir, files_to_symlink,
|
1065
|
+
files_to_copy, symlink=None):
|
1066
|
+
if not symlink:
|
1067
|
+
symlink = os.symlink
|
1068
|
+
os.makedirs(new_workdir)
|
1069
|
+
for entry in files_to_symlink:
|
1070
|
+
clone_file(repository, new_workdir, entry, symlink)
|
1071
|
+
for entry in files_to_copy:
|
1072
|
+
clone_file(repository, new_workdir, entry, shutil.copy)
|
1073
|
+
|
1074
|
+
|
1075
|
+
def make_workdir(repository, new_workdir):
|
1076
|
+
GIT_DIRECTORY_WHITELIST = [
|
1077
|
+
'config',
|
1078
|
+
'info',
|
1079
|
+
'hooks',
|
1080
|
+
'logs/refs',
|
1081
|
+
'objects',
|
1082
|
+
'packed-refs',
|
1083
|
+
'refs',
|
1084
|
+
'remotes',
|
1085
|
+
'rr-cache',
|
1086
|
+
'shallow',
|
1087
|
+
]
|
1088
|
+
make_workdir_common(repository, new_workdir, GIT_DIRECTORY_WHITELIST,
|
1089
|
+
['HEAD'])
|
1090
|
+
|
1091
|
+
|
1092
|
+
def clone_file(repository, new_workdir, link, operation):
|
1093
|
+
if not os.path.exists(os.path.join(repository, link)):
|
1094
|
+
return
|
1095
|
+
link_dir = os.path.dirname(os.path.join(new_workdir, link))
|
1096
|
+
if not os.path.exists(link_dir):
|
1097
|
+
os.makedirs(link_dir)
|
1098
|
+
src = os.path.join(repository, link)
|
1099
|
+
if os.path.islink(src):
|
1100
|
+
src = os.path.realpath(src)
|
1101
|
+
operation(src, os.path.join(new_workdir, link))
|