libv8 5.3.332.38.5 → 5.6.326.50.0beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +2 -0
- data/ext/libv8/builder.rb +2 -2
- data/lib/libv8/version.rb +1 -1
- data/patches/0001-Build-a-standalone-static-library.patch +4 -4
- data/patches/0002-Don-t-compile-unnecessary-stuff.patch +16 -11
- data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +4 -4
- data/patches/{0005-Do-not-embed-debug-symbols-in-macOS-libraries.patch → 0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch} +4 -4
- data/vendor/depot_tools/.gitignore +4 -0
- data/vendor/depot_tools/OWNERS +0 -2
- data/vendor/depot_tools/PRESUBMIT.py +20 -23
- data/vendor/depot_tools/README.gclient.md +3 -3
- data/vendor/depot_tools/README.git-cl.md +13 -12
- data/vendor/depot_tools/README.md +2 -3
- data/vendor/depot_tools/WATCHLISTS +0 -1
- data/vendor/depot_tools/appengine_mapper.py +23 -0
- data/vendor/depot_tools/apply_issue.py +2 -8
- data/vendor/depot_tools/bootstrap/win/README.md +1 -8
- data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +6 -16
- data/vendor/depot_tools/bootstrap/win/git_version.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +1 -1
- data/vendor/depot_tools/checkout.py +20 -433
- data/vendor/depot_tools/cipd +73 -0
- data/vendor/depot_tools/cipd.bat +12 -0
- data/vendor/depot_tools/cipd.ps1 +57 -0
- data/vendor/depot_tools/cipd_client_version +1 -0
- data/vendor/depot_tools/clang_format.py +9 -6
- data/vendor/depot_tools/clang_format_merge_driver +8 -0
- data/vendor/depot_tools/clang_format_merge_driver.bat +11 -0
- data/vendor/depot_tools/clang_format_merge_driver.py +67 -0
- data/vendor/depot_tools/codereview.settings +3 -2
- data/vendor/depot_tools/commit_queue.py +1 -1
- data/vendor/depot_tools/cpplint.py +2 -0
- data/vendor/depot_tools/fetch.py +1 -54
- data/vendor/depot_tools/fetch_configs/android.py +2 -2
- data/vendor/depot_tools/fetch_configs/breakpad.py +2 -3
- data/vendor/depot_tools/fetch_configs/chromium.py +2 -3
- data/vendor/depot_tools/fetch_configs/crashpad.py +2 -2
- data/vendor/depot_tools/fetch_configs/dart.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartino.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartium.py +2 -3
- data/vendor/depot_tools/fetch_configs/depot_tools.py +3 -6
- data/vendor/depot_tools/fetch_configs/gyp.py +2 -3
- data/vendor/depot_tools/fetch_configs/infra.py +2 -2
- data/vendor/depot_tools/fetch_configs/infra_internal.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios_internal.py +2 -3
- data/vendor/depot_tools/fetch_configs/mojo.py +2 -3
- data/vendor/depot_tools/fetch_configs/nacl.py +2 -3
- data/vendor/depot_tools/fetch_configs/naclports.py +2 -3
- data/vendor/depot_tools/fetch_configs/pdfium.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia_buildbot.py +2 -2
- data/vendor/depot_tools/fetch_configs/syzygy.py +2 -2
- data/vendor/depot_tools/fetch_configs/v8.py +2 -3
- data/vendor/depot_tools/fetch_configs/webrtc.py +5 -3
- data/vendor/depot_tools/fetch_configs/webrtc_android.py +2 -2
- data/vendor/depot_tools/fetch_configs/webrtc_ios.py +2 -2
- data/vendor/depot_tools/fix_encoding.py +6 -6
- data/vendor/depot_tools/gclient.py +136 -368
- data/vendor/depot_tools/gclient_scm.py +108 -647
- data/vendor/depot_tools/gclient_utils.py +22 -86
- data/vendor/depot_tools/gerrit_client.py +105 -0
- data/vendor/depot_tools/gerrit_util.py +174 -67
- data/vendor/depot_tools/git-crrev-parse +6 -7
- data/vendor/depot_tools/git-gs +1 -1
- data/vendor/depot_tools/git_cache.py +68 -18
- data/vendor/depot_tools/git_cherry_pick_upload.py +4 -4
- data/vendor/depot_tools/git_cl.py +1028 -961
- data/vendor/depot_tools/git_common.py +2 -3
- data/vendor/depot_tools/git_drover.py +0 -1
- data/vendor/depot_tools/git_footers.py +3 -43
- data/vendor/depot_tools/git_rebase_update.py +9 -1
- data/vendor/depot_tools/git_squash_branch.py +1 -1
- data/vendor/depot_tools/infra/config/cq.cfg +8 -1
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/man/html/depot_tools.html +3 -11
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +9 -9
- data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +2 -2
- data/vendor/depot_tools/man/html/git-drover.html +17 -17
- data/vendor/depot_tools/man/html/git-footers.html +2 -2
- data/vendor/depot_tools/man/html/git-freeze.html +4 -4
- data/vendor/depot_tools/man/html/git-hyper-blame.html +2 -2
- data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
- data/vendor/depot_tools/man/html/git-map.html +2 -2
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-downstream.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-upstream.html +2 -2
- data/vendor/depot_tools/man/html/git-new-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-rebase-update.html +2 -2
- data/vendor/depot_tools/man/html/git-rename-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-reparent-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-retry.html +3 -3
- data/vendor/depot_tools/man/html/git-squash-branch.html +3 -3
- data/vendor/depot_tools/man/html/git-thaw.html +2 -2
- data/vendor/depot_tools/man/html/git-upstream-diff.html +3 -3
- data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +4 -4
- data/vendor/depot_tools/man/man1/git-drover.1 +19 -19
- data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
- data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map.1 +4 -4
- data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-downstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-new-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-retry.1 +5 -5
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +5 -5
- data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +5 -5
- data/vendor/depot_tools/man/man7/depot_tools.7 +5 -10
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +4 -4
- data/vendor/depot_tools/man/src/depot_tools.txt +1 -1
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +7 -7
- data/vendor/depot_tools/man/src/filter_demo_output.py +2 -2
- data/vendor/depot_tools/man/src/git-footers.demo.1.sh +1 -1
- data/vendor/depot_tools/man/src/git-retry.txt +1 -1
- data/vendor/depot_tools/man/src/git-squash-branch.txt +2 -2
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +1 -1
- data/vendor/depot_tools/my_activity.py +6 -3
- data/vendor/depot_tools/my_reviews.py +1 -1
- data/vendor/depot_tools/ninja +2 -2
- 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/owners.py +14 -3
- data/vendor/depot_tools/presubmit_canned_checks.py +46 -67
- data/vendor/depot_tools/presubmit_support.py +109 -371
- data/vendor/depot_tools/pylintrc +83 -56
- data/vendor/depot_tools/recipe_modules/OWNERS +1 -0
- data/vendor/depot_tools/recipe_modules/bot_update/__init__.py +18 -9
- data/vendor/depot_tools/recipe_modules/bot_update/api.py +56 -55
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/buildbot.json +52 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +2 -54
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +56 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/{forced.json → trychange_oauth2_json.json} +6 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +54 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +59 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.py +45 -63
- data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +210 -807
- data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +34 -45
- data/vendor/depot_tools/recipe_modules/cipd/api.py +59 -84
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/basic.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-failed.json +14 -60
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-many-instances.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/mac64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/win64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.py +2 -12
- data/vendor/depot_tools/recipe_modules/cipd/test_api.py +0 -9
- data/vendor/depot_tools/recipe_modules/depot_tools/api.py +6 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/basic.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/win.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.py +3 -0
- data/vendor/depot_tools/recipe_modules/gclient/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gclient/api.py +9 -22
- data/vendor/depot_tools/recipe_modules/gclient/config.py +18 -5
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +14 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/buildbot.json +211 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.py +13 -11
- data/vendor/depot_tools/recipe_modules/gerrit/__init__.py +6 -0
- data/vendor/depot_tools/recipe_modules/gerrit/api.py +63 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.expected/basic.json +64 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.py +35 -0
- data/vendor/depot_tools/recipe_modules/gerrit/test_api.py +24 -0
- data/vendor/depot_tools/recipe_modules/git/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git/api.py +155 -142
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +13 -13
- data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +8 -8
- data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +44 -18
- data/vendor/depot_tools/recipe_modules/git/example.expected/git-cache-checkout.json +48 -22
- data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +42 -16
- data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.py +9 -3
- data/vendor/depot_tools/recipe_modules/git_cl/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git_cl/api.py +8 -8
- data/vendor/depot_tools/recipe_modules/git_cl/example.py +1 -1
- data/vendor/depot_tools/recipe_modules/gsutil/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gsutil/api.py +196 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.expected/basic.json +186 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.py +77 -0
- data/vendor/depot_tools/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/__init__.py +3 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/api.py +20 -3
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/basic.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.py +6 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/path_config.py +4 -6
- data/vendor/depot_tools/recipe_modules/rietveld/__init__.py +5 -0
- data/vendor/depot_tools/recipe_modules/rietveld/api.py +12 -9
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/basic.json +2 -24
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/buildbot.json +30 -0
- data/vendor/depot_tools/recipe_modules/rietveld/example.py +12 -6
- data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/tryserver/api.py +46 -70
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/set_failure_hash_with_no_steps.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/{with_svn_patch.json → with_gerrit_patch.json} +1 -31
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_gerrit_patch_deprecated.json +39 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch.json +2 -2
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch_luci.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.py +35 -5
- data/vendor/depot_tools/recipes.py +52 -28
- data/vendor/depot_tools/repo +216 -69
- data/vendor/depot_tools/rietveld.py +20 -15
- data/vendor/depot_tools/roll_dep.py +1 -1
- data/vendor/depot_tools/scm.py +11 -826
- data/vendor/depot_tools/subprocess2.py +5 -5
- data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +2 -0
- data/vendor/depot_tools/third_party/cq_client/README.md +5 -1
- data/vendor/depot_tools/third_party/cq_client/cq.pb.go +183 -104
- data/vendor/depot_tools/third_party/cq_client/cq.proto +43 -27
- data/vendor/depot_tools/third_party/cq_client/cq_pb2.py +95 -29
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_both.cfg +67 -0
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_gerrit.cfg +1 -2
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_rietveld.cfg +0 -3
- data/vendor/depot_tools/third_party/upload.py +44 -24
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +0 -5
- metadata +38 -93
- data/patches/0004-Reinterpret-thread-hash-for-FreeBSD-too.patch +0 -25
- data/vendor/depot_tools/git-auto-svn +0 -6
- data/vendor/depot_tools/git_auto_svn.py +0 -122
- data/vendor/depot_tools/man/html/git-auto-svn.html +0 -837
- data/vendor/depot_tools/man/man1/git-auto-svn.1 +0 -113
- data/vendor/depot_tools/man/src/_git-auto-svn_desc.helper.txt +0 -1
- data/vendor/depot_tools/man/src/git-auto-svn.txt +0 -69
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +0 -43
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/install-failed.json +0 -31
- data/vendor/depot_tools/recipe_modules/cipd/resources/bootstrap.py +0 -218
- data/vendor/depot_tools/recipe_modules/tryserver/test_api.py +0 -7
- data/vendor/depot_tools/third_party/gsutil/CHECKSUM +0 -1
- data/vendor/depot_tools/third_party/gsutil/COPYING +0 -202
- data/vendor/depot_tools/third_party/gsutil/LICENSE.third_party +0 -295
- data/vendor/depot_tools/third_party/gsutil/MANIFEST.in +0 -5
- data/vendor/depot_tools/third_party/gsutil/README +0 -38
- data/vendor/depot_tools/third_party/gsutil/README.chromium +0 -25
- data/vendor/depot_tools/third_party/gsutil/README.pkg +0 -49
- data/vendor/depot_tools/third_party/gsutil/ReleaseNotes.txt +0 -825
- data/vendor/depot_tools/third_party/gsutil/VERSION +0 -1
- data/vendor/depot_tools/third_party/gsutil/gslib/README +0 -5
- data/vendor/depot_tools/third_party/gsutil/gslib/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/acls.py +0 -234
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/anon.py +0 -57
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/command_opts.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/dev.py +0 -139
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/metadata.py +0 -186
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/naming.py +0 -173
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/prod.py +0 -160
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/projects.py +0 -130
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/subdirs.py +0 -110
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/support.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/versioning.py +0 -242
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/wildcards.py +0 -170
- data/vendor/depot_tools/third_party/gsutil/gslib/bucket_listing_ref.py +0 -175
- data/vendor/depot_tools/third_party/gsutil/gslib/command.py +0 -725
- data/vendor/depot_tools/third_party/gsutil/gslib/command_runner.py +0 -102
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cat.py +0 -131
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/chacl.py +0 -523
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/config.py +0 -662
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cp.py +0 -1819
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/disablelogging.py +0 -101
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/enablelogging.py +0 -149
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getacl.py +0 -82
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getcors.py +0 -121
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getdefacl.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getlogging.py +0 -137
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getversioning.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getwebcfg.py +0 -122
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/help.py +0 -218
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/ls.py +0 -578
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mb.py +0 -172
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mv.py +0 -159
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/perfdiag.py +0 -903
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rb.py +0 -113
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rm.py +0 -237
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setacl.py +0 -138
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setcors.py +0 -145
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setdefacl.py +0 -105
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setmeta.py +0 -420
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setversioning.py +0 -114
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setwebcfg.py +0 -190
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/update.py +0 -305
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/version.py +0 -150
- data/vendor/depot_tools/third_party/gsutil/gslib/exception.py +0 -76
- data/vendor/depot_tools/third_party/gsutil/gslib/help_provider.py +0 -81
- data/vendor/depot_tools/third_party/gsutil/gslib/name_expansion.py +0 -550
- data/vendor/depot_tools/third_party/gsutil/gslib/no_op_auth_plugin.py +0 -30
- data/vendor/depot_tools/third_party/gsutil/gslib/plurality_checkable_iterator.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/project_id.py +0 -67
- data/vendor/depot_tools/third_party/gsutil/gslib/storage_uri_builder.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/thread_pool.py +0 -79
- data/vendor/depot_tools/third_party/gsutil/gslib/util.py +0 -167
- data/vendor/depot_tools/third_party/gsutil/gslib/wildcard_iterator.py +0 -498
- data/vendor/depot_tools/third_party/gsutil/gsutil +0 -384
- data/vendor/depot_tools/third_party/gsutil/gsutil.spec.in +0 -75
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client.py +0 -630
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client_test.py +0 -374
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_helper.py +0 -103
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_plugin.py +0 -24
- data/vendor/depot_tools/third_party/gsutil/pkg_util.py +0 -60
- data/vendor/depot_tools/third_party/gsutil/plugins/__init__.py +0 -0
- data/vendor/depot_tools/third_party/gsutil/plugins/sso_auth.py +0 -105
@@ -72,7 +72,7 @@ class Rietveld(object):
|
|
72
72
|
logging.info('closing issue %d' % issue)
|
73
73
|
self.post("/%d/close" % issue, [('xsrf_token', self.xsrf_token())])
|
74
74
|
|
75
|
-
def get_description(self, issue):
|
75
|
+
def get_description(self, issue, force=False):
|
76
76
|
"""Returns the issue's description.
|
77
77
|
|
78
78
|
Converts any CRLF into LF and strip extraneous whitespace.
|
@@ -449,13 +449,15 @@ class Rietveld(object):
|
|
449
449
|
'EOF occurred in violation of protocol',
|
450
450
|
'timed out',
|
451
451
|
# See http://crbug.com/601260.
|
452
|
-
'
|
453
|
-
'
|
452
|
+
'[Errno 10060] A connection attempt failed',
|
453
|
+
'[Errno 104] Connection reset by peer',
|
454
454
|
):
|
455
455
|
if retry_anyway in reason_as_str:
|
456
456
|
return True
|
457
457
|
return False # Assume permanent otherwise.
|
458
458
|
if not is_transient():
|
459
|
+
logging.error('Caught urllib2.URLError %s which wasn\'t deemed '
|
460
|
+
'transient', e.reason)
|
459
461
|
raise
|
460
462
|
except socket.error, e:
|
461
463
|
if retry >= (self._maxtries - 1):
|
@@ -602,7 +604,7 @@ class JwtOAuth2Rietveld(Rietveld):
|
|
602
604
|
access is restricted to service accounts.
|
603
605
|
"""
|
604
606
|
# The parent__init__ is not called on purpose.
|
605
|
-
# pylint: disable=
|
607
|
+
# pylint: disable=super-init-not-called
|
606
608
|
def __init__(self,
|
607
609
|
url,
|
608
610
|
client_email,
|
@@ -652,11 +654,14 @@ class CachingRietveld(Rietveld):
|
|
652
654
|
function_cache[args] = update(*args)
|
653
655
|
return copy.deepcopy(function_cache[args])
|
654
656
|
|
655
|
-
def get_description(self, issue):
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
657
|
+
def get_description(self, issue, force=False):
|
658
|
+
if force:
|
659
|
+
return super(CachingRietveld, self).get_description(issue, force=force)
|
660
|
+
else:
|
661
|
+
return self._lookup(
|
662
|
+
'get_description',
|
663
|
+
(issue,),
|
664
|
+
super(CachingRietveld, self).get_description)
|
660
665
|
|
661
666
|
def get_issue_properties(self, issue, messages):
|
662
667
|
"""Returns the issue properties.
|
@@ -716,7 +721,7 @@ class ReadOnlyRietveld(object):
|
|
716
721
|
if not self._get_local_changes(issue).get('closed', False) and
|
717
722
|
self._get_local_changes(issue).get('commit', True)]
|
718
723
|
|
719
|
-
def close_issue(self, issue): # pylint:disable=
|
724
|
+
def close_issue(self, issue): # pylint:disable=no-self-use
|
720
725
|
logging.info('ReadOnlyRietveld: closing issue %d' % issue)
|
721
726
|
ReadOnlyRietveld._local_changes.setdefault(issue, {})['closed'] = True
|
722
727
|
|
@@ -734,18 +739,18 @@ class ReadOnlyRietveld(object):
|
|
734
739
|
def get_patch(self, issue, patchset):
|
735
740
|
return self._rietveld.get_patch(issue, patchset)
|
736
741
|
|
737
|
-
def update_description(self, issue, description): # pylint:disable=
|
742
|
+
def update_description(self, issue, description): # pylint:disable=no-self-use
|
738
743
|
logging.info('ReadOnlyRietveld: new description for issue %d: %s' %
|
739
744
|
(issue, description))
|
740
745
|
|
741
|
-
def add_comment(self, # pylint:disable=
|
746
|
+
def add_comment(self, # pylint:disable=no-self-use
|
742
747
|
issue,
|
743
748
|
message,
|
744
749
|
add_as_reviewer=False):
|
745
750
|
logging.info('ReadOnlyRietveld: posting comment "%s" to issue %d' %
|
746
751
|
(message, issue))
|
747
752
|
|
748
|
-
def set_flag(self, issue, patchset, flag, value): # pylint:disable=
|
753
|
+
def set_flag(self, issue, patchset, flag, value): # pylint:disable=no-self-use
|
749
754
|
logging.info('ReadOnlyRietveld: setting flag "%s" to "%s" for issue %d' %
|
750
755
|
(flag, value, issue))
|
751
756
|
ReadOnlyRietveld._local_changes.setdefault(issue, {})[flag] = value
|
@@ -754,13 +759,13 @@ class ReadOnlyRietveld(object):
|
|
754
759
|
for flag, value in flags.iteritems():
|
755
760
|
self.set_flag(issue, patchset, flag, value)
|
756
761
|
|
757
|
-
def trigger_try_jobs( # pylint:disable=
|
762
|
+
def trigger_try_jobs( # pylint:disable=no-self-use
|
758
763
|
self, issue, patchset, reason, clobber, revision, builders_and_tests,
|
759
764
|
master=None, category='cq'):
|
760
765
|
logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
|
761
766
|
(builders_and_tests, issue))
|
762
767
|
|
763
|
-
def trigger_distributed_try_jobs( # pylint:disable=
|
768
|
+
def trigger_distributed_try_jobs( # pylint:disable=no-self-use
|
764
769
|
self, issue, patchset, reason, clobber, revision, masters,
|
765
770
|
category='cq'):
|
766
771
|
logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' %
|
@@ -144,7 +144,7 @@ def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit,
|
|
144
144
|
# Keep the first N log entries.
|
145
145
|
logs = ''.join(logs.splitlines(True)[:log_limit]) + '(...)\n'
|
146
146
|
log_section += logs
|
147
|
-
log_section += '\n'
|
147
|
+
log_section += '\n\nCreated with:\n roll-dep %s\n' % deps_dir
|
148
148
|
|
149
149
|
reviewer = 'R=%s\n' % ','.join(reviewers) if reviewers else ''
|
150
150
|
bug = 'BUG=%s\n' % bug if bug else ''
|
data/vendor/depot_tools/scm.py
CHANGED
@@ -68,11 +68,9 @@ def GenFakeDiff(filename):
|
|
68
68
|
def determine_scm(root):
|
69
69
|
"""Similar to upload.py's version but much simpler.
|
70
70
|
|
71
|
-
Returns '
|
71
|
+
Returns 'git' or None.
|
72
72
|
"""
|
73
|
-
if os.path.isdir(os.path.join(root, '.
|
74
|
-
return 'svn'
|
75
|
-
elif os.path.isdir(os.path.join(root, '.git')):
|
73
|
+
if os.path.isdir(os.path.join(root, '.git')):
|
76
74
|
return 'git'
|
77
75
|
else:
|
78
76
|
try:
|
@@ -162,8 +160,6 @@ class GIT(object):
|
|
162
160
|
@staticmethod
|
163
161
|
def GetEmail(cwd):
|
164
162
|
"""Retrieves the user email address if known."""
|
165
|
-
# We could want to look at the svn cred when it has a svn remote but it
|
166
|
-
# should be fine for now, users should simply configure their git settings.
|
167
163
|
try:
|
168
164
|
return GIT.Capture(['config', 'user.email'], cwd=cwd)
|
169
165
|
except subprocess2.CalledProcessError:
|
@@ -184,126 +180,10 @@ class GIT(object):
|
|
184
180
|
"""Returns the short branch name, e.g. 'master'."""
|
185
181
|
return GIT.ShortBranchName(GIT.GetBranchRef(cwd))
|
186
182
|
|
187
|
-
@staticmethod
|
188
|
-
def IsGitSvn(cwd):
|
189
|
-
"""Returns True if this repo looks like it's using git-svn."""
|
190
|
-
# If you have any "svn-remote.*" config keys, we think you're using svn.
|
191
|
-
try:
|
192
|
-
GIT.Capture(['config', '--local', '--get-regexp', r'^svn-remote\.'],
|
193
|
-
cwd=cwd)
|
194
|
-
return True
|
195
|
-
except subprocess2.CalledProcessError:
|
196
|
-
return False
|
197
|
-
|
198
|
-
@staticmethod
|
199
|
-
def MatchSvnGlob(url, base_url, glob_spec, allow_wildcards):
|
200
|
-
"""Return the corresponding git ref if |base_url| together with |glob_spec|
|
201
|
-
matches the full |url|.
|
202
|
-
|
203
|
-
If |allow_wildcards| is true, |glob_spec| can contain wildcards (see below).
|
204
|
-
"""
|
205
|
-
fetch_suburl, as_ref = glob_spec.split(':')
|
206
|
-
if allow_wildcards:
|
207
|
-
glob_match = re.match('(.+/)?(\*|{[^/]*})(/.+)?', fetch_suburl)
|
208
|
-
if glob_match:
|
209
|
-
# Parse specs like "branches/*/src:refs/remotes/svn/*" or
|
210
|
-
# "branches/{472,597,648}/src:refs/remotes/svn/*".
|
211
|
-
branch_re = re.escape(base_url)
|
212
|
-
if glob_match.group(1):
|
213
|
-
branch_re += '/' + re.escape(glob_match.group(1))
|
214
|
-
wildcard = glob_match.group(2)
|
215
|
-
if wildcard == '*':
|
216
|
-
branch_re += '([^/]*)'
|
217
|
-
else:
|
218
|
-
# Escape and replace surrounding braces with parentheses and commas
|
219
|
-
# with pipe symbols.
|
220
|
-
wildcard = re.escape(wildcard)
|
221
|
-
wildcard = re.sub('^\\\\{', '(', wildcard)
|
222
|
-
wildcard = re.sub('\\\\,', '|', wildcard)
|
223
|
-
wildcard = re.sub('\\\\}$', ')', wildcard)
|
224
|
-
branch_re += wildcard
|
225
|
-
if glob_match.group(3):
|
226
|
-
branch_re += re.escape(glob_match.group(3))
|
227
|
-
match = re.match(branch_re, url)
|
228
|
-
if match:
|
229
|
-
return re.sub('\*$', match.group(1), as_ref)
|
230
|
-
|
231
|
-
# Parse specs like "trunk/src:refs/remotes/origin/trunk".
|
232
|
-
if fetch_suburl:
|
233
|
-
full_url = base_url + '/' + fetch_suburl
|
234
|
-
else:
|
235
|
-
full_url = base_url
|
236
|
-
if full_url == url:
|
237
|
-
return as_ref
|
238
|
-
return None
|
239
|
-
|
240
|
-
@staticmethod
|
241
|
-
def GetSVNBranch(cwd):
|
242
|
-
"""Returns the svn branch name if found."""
|
243
|
-
# Try to figure out which remote branch we're based on.
|
244
|
-
# Strategy:
|
245
|
-
# 1) iterate through our branch history and find the svn URL.
|
246
|
-
# 2) find the svn-remote that fetches from the URL.
|
247
|
-
|
248
|
-
# regexp matching the git-svn line that contains the URL.
|
249
|
-
git_svn_re = re.compile(r'^\s*git-svn-id: (\S+)@', re.MULTILINE)
|
250
|
-
|
251
|
-
# We don't want to go through all of history, so read a line from the
|
252
|
-
# pipe at a time.
|
253
|
-
# The -100 is an arbitrary limit so we don't search forever.
|
254
|
-
cmd = ['git', 'log', '-100', '--pretty=medium']
|
255
|
-
proc = subprocess2.Popen(cmd, cwd=cwd, stdout=subprocess2.PIPE)
|
256
|
-
url = None
|
257
|
-
for line in proc.stdout:
|
258
|
-
match = git_svn_re.match(line)
|
259
|
-
if match:
|
260
|
-
url = match.group(1)
|
261
|
-
proc.stdout.close() # Cut pipe.
|
262
|
-
break
|
263
|
-
|
264
|
-
if url:
|
265
|
-
svn_remote_re = re.compile(r'^svn-remote\.([^.]+)\.url (.*)$')
|
266
|
-
remotes = GIT.Capture(
|
267
|
-
['config', '--local', '--get-regexp', r'^svn-remote\..*\.url'],
|
268
|
-
cwd=cwd).splitlines()
|
269
|
-
for remote in remotes:
|
270
|
-
match = svn_remote_re.match(remote)
|
271
|
-
if match:
|
272
|
-
remote = match.group(1)
|
273
|
-
base_url = match.group(2)
|
274
|
-
try:
|
275
|
-
fetch_spec = GIT.Capture(
|
276
|
-
['config', '--local', 'svn-remote.%s.fetch' % remote],
|
277
|
-
cwd=cwd)
|
278
|
-
branch = GIT.MatchSvnGlob(url, base_url, fetch_spec, False)
|
279
|
-
except subprocess2.CalledProcessError:
|
280
|
-
branch = None
|
281
|
-
if branch:
|
282
|
-
return branch
|
283
|
-
try:
|
284
|
-
branch_spec = GIT.Capture(
|
285
|
-
['config', '--local', 'svn-remote.%s.branches' % remote],
|
286
|
-
cwd=cwd)
|
287
|
-
branch = GIT.MatchSvnGlob(url, base_url, branch_spec, True)
|
288
|
-
except subprocess2.CalledProcessError:
|
289
|
-
branch = None
|
290
|
-
if branch:
|
291
|
-
return branch
|
292
|
-
try:
|
293
|
-
tag_spec = GIT.Capture(
|
294
|
-
['config', '--local', 'svn-remote.%s.tags' % remote],
|
295
|
-
cwd=cwd)
|
296
|
-
branch = GIT.MatchSvnGlob(url, base_url, tag_spec, True)
|
297
|
-
except subprocess2.CalledProcessError:
|
298
|
-
branch = None
|
299
|
-
if branch:
|
300
|
-
return branch
|
301
|
-
|
302
183
|
@staticmethod
|
303
184
|
def FetchUpstreamTuple(cwd):
|
304
185
|
"""Returns a tuple containg remote and remote ref,
|
305
186
|
e.g. 'origin', 'refs/heads/master'
|
306
|
-
Tries to be intelligent and understand git-svn.
|
307
187
|
"""
|
308
188
|
remote = '.'
|
309
189
|
branch = GIT.GetBranch(cwd)
|
@@ -331,25 +211,16 @@ class GIT(object):
|
|
331
211
|
except subprocess2.CalledProcessError:
|
332
212
|
pass
|
333
213
|
else:
|
334
|
-
#
|
335
|
-
|
336
|
-
|
214
|
+
# Else, try to guess the origin remote.
|
215
|
+
remote_branches = GIT.Capture(['branch', '-r'], cwd=cwd).split()
|
216
|
+
if 'origin/master' in remote_branches:
|
217
|
+
# Fall back on origin/master if it exits.
|
218
|
+
remote = 'origin'
|
219
|
+
upstream_branch = 'refs/heads/master'
|
337
220
|
else:
|
338
|
-
#
|
339
|
-
|
340
|
-
|
341
|
-
# Fall back on origin/master if it exits.
|
342
|
-
remote = 'origin'
|
343
|
-
upstream_branch = 'refs/heads/master'
|
344
|
-
elif 'origin/trunk' in remote_branches:
|
345
|
-
# Fall back on origin/trunk if it exists. Generally a shared
|
346
|
-
# git-svn clone
|
347
|
-
remote = 'origin'
|
348
|
-
upstream_branch = 'refs/heads/trunk'
|
349
|
-
else:
|
350
|
-
# Give up.
|
351
|
-
remote = None
|
352
|
-
upstream_branch = None
|
221
|
+
# Give up.
|
222
|
+
remote = None
|
223
|
+
upstream_branch = None
|
353
224
|
return remote, upstream_branch
|
354
225
|
|
355
226
|
@staticmethod
|
@@ -452,61 +323,6 @@ class GIT(object):
|
|
452
323
|
"""Cleans up untracked file inside |relative_dir|."""
|
453
324
|
return bool(GIT.Capture(['clean', '-df', relative_dir], cwd=cwd))
|
454
325
|
|
455
|
-
@staticmethod
|
456
|
-
def GetGitSvnHeadRev(cwd):
|
457
|
-
"""Gets the most recently pulled git-svn revision."""
|
458
|
-
try:
|
459
|
-
output = GIT.Capture(['svn', 'info'], cwd=cwd)
|
460
|
-
match = re.search(r'^Revision: ([0-9]+)$', output, re.MULTILINE)
|
461
|
-
return int(match.group(1)) if match else None
|
462
|
-
except (subprocess2.CalledProcessError, ValueError):
|
463
|
-
return None
|
464
|
-
|
465
|
-
@staticmethod
|
466
|
-
def ParseGitSvnSha1(output):
|
467
|
-
"""Parses git-svn output for the first sha1."""
|
468
|
-
match = re.search(r'[0-9a-fA-F]{40}', output)
|
469
|
-
return match.group(0) if match else None
|
470
|
-
|
471
|
-
@staticmethod
|
472
|
-
def GetSha1ForSvnRev(cwd, rev):
|
473
|
-
"""Returns a corresponding git sha1 for a SVN revision."""
|
474
|
-
if not GIT.IsGitSvn(cwd=cwd):
|
475
|
-
return None
|
476
|
-
try:
|
477
|
-
output = GIT.Capture(['svn', 'find-rev', 'r' + str(rev)], cwd=cwd)
|
478
|
-
return GIT.ParseGitSvnSha1(output)
|
479
|
-
except subprocess2.CalledProcessError:
|
480
|
-
return None
|
481
|
-
|
482
|
-
@staticmethod
|
483
|
-
def GetBlessedSha1ForSvnRev(cwd, rev):
|
484
|
-
"""Returns a git commit hash from the master branch history that has
|
485
|
-
accurate .DEPS.git and git submodules. To understand why this is more
|
486
|
-
complicated than a simple call to `git svn find-rev`, refer to:
|
487
|
-
|
488
|
-
http://www.chromium.org/developers/how-tos/git-repo
|
489
|
-
"""
|
490
|
-
git_svn_rev = GIT.GetSha1ForSvnRev(cwd, rev)
|
491
|
-
if not git_svn_rev:
|
492
|
-
return None
|
493
|
-
try:
|
494
|
-
output = GIT.Capture(
|
495
|
-
['rev-list', '--ancestry-path', '--reverse',
|
496
|
-
'--grep', 'SVN changes up to revision [0-9]*',
|
497
|
-
'%s..refs/remotes/origin/master' % git_svn_rev], cwd=cwd)
|
498
|
-
if not output:
|
499
|
-
return None
|
500
|
-
sha1 = output.splitlines()[0]
|
501
|
-
if not sha1:
|
502
|
-
return None
|
503
|
-
output = GIT.Capture(['rev-list', '-n', '1', '%s^1' % sha1], cwd=cwd)
|
504
|
-
if git_svn_rev != output.rstrip():
|
505
|
-
raise gclient_utils.Error(sha1)
|
506
|
-
return sha1
|
507
|
-
except subprocess2.CalledProcessError:
|
508
|
-
return None
|
509
|
-
|
510
326
|
@staticmethod
|
511
327
|
def IsValidRevision(cwd, rev, sha_only=False):
|
512
328
|
"""Verifies the revision is a proper git revision.
|
@@ -546,634 +362,3 @@ class GIT(object):
|
|
546
362
|
elif ver > min_ver:
|
547
363
|
return (True, cls.current_version)
|
548
364
|
return (True, cls.current_version)
|
549
|
-
|
550
|
-
|
551
|
-
class SVN(object):
|
552
|
-
current_version = None
|
553
|
-
|
554
|
-
@staticmethod
|
555
|
-
def Capture(args, cwd, **kwargs):
|
556
|
-
"""Always redirect stderr.
|
557
|
-
|
558
|
-
Throws an exception if non-0 is returned.
|
559
|
-
"""
|
560
|
-
return subprocess2.check_output(
|
561
|
-
['svn'] + args, stderr=subprocess2.PIPE, cwd=cwd, **kwargs)
|
562
|
-
|
563
|
-
@staticmethod
|
564
|
-
def RunAndGetFileList(verbose, args, cwd, file_list, stdout=None):
|
565
|
-
"""Runs svn checkout, update, or status, output to stdout.
|
566
|
-
|
567
|
-
The first item in args must be either "checkout", "update", or "status".
|
568
|
-
|
569
|
-
svn's stdout is parsed to collect a list of files checked out or updated.
|
570
|
-
These files are appended to file_list. svn's stdout is also printed to
|
571
|
-
sys.stdout as in Run.
|
572
|
-
|
573
|
-
Args:
|
574
|
-
verbose: If True, uses verbose output
|
575
|
-
args: A sequence of command line parameters to be passed to svn.
|
576
|
-
cwd: The directory where svn is to be run.
|
577
|
-
|
578
|
-
Raises:
|
579
|
-
Error: An error occurred while running the svn command.
|
580
|
-
"""
|
581
|
-
stdout = stdout or sys.stdout
|
582
|
-
if file_list is None:
|
583
|
-
# Even if our caller doesn't care about file_list, we use it internally.
|
584
|
-
file_list = []
|
585
|
-
|
586
|
-
# svn update and svn checkout use the same pattern: the first three columns
|
587
|
-
# are for file status, property status, and lock status. This is followed
|
588
|
-
# by two spaces, and then the path to the file.
|
589
|
-
update_pattern = '^... (.*)$'
|
590
|
-
|
591
|
-
# The first three columns of svn status are the same as for svn update and
|
592
|
-
# svn checkout. The next three columns indicate addition-with-history,
|
593
|
-
# switch, and remote lock status. This is followed by one space, and then
|
594
|
-
# the path to the file.
|
595
|
-
status_pattern = '^...... (.*)$'
|
596
|
-
|
597
|
-
# args[0] must be a supported command. This will blow up if it's something
|
598
|
-
# else, which is good. Note that the patterns are only effective when
|
599
|
-
# these commands are used in their ordinary forms, the patterns are invalid
|
600
|
-
# for "svn status --show-updates", for example.
|
601
|
-
pattern = {
|
602
|
-
'checkout': update_pattern,
|
603
|
-
'status': status_pattern,
|
604
|
-
'update': update_pattern,
|
605
|
-
}[args[0]]
|
606
|
-
compiled_pattern = re.compile(pattern)
|
607
|
-
# Place an upper limit.
|
608
|
-
backoff_time = 5
|
609
|
-
retries = 0
|
610
|
-
while True:
|
611
|
-
retries += 1
|
612
|
-
previous_list_len = len(file_list)
|
613
|
-
failure = []
|
614
|
-
|
615
|
-
def CaptureMatchingLines(line):
|
616
|
-
match = compiled_pattern.search(line)
|
617
|
-
if match:
|
618
|
-
file_list.append(match.group(1))
|
619
|
-
if line.startswith('svn: '):
|
620
|
-
failure.append(line)
|
621
|
-
|
622
|
-
try:
|
623
|
-
gclient_utils.CheckCallAndFilterAndHeader(
|
624
|
-
['svn'] + args,
|
625
|
-
cwd=cwd,
|
626
|
-
always=verbose,
|
627
|
-
filter_fn=CaptureMatchingLines,
|
628
|
-
stdout=stdout)
|
629
|
-
except subprocess2.CalledProcessError:
|
630
|
-
def IsKnownFailure():
|
631
|
-
for x in failure:
|
632
|
-
if (x.startswith('svn: OPTIONS of') or
|
633
|
-
x.startswith('svn: PROPFIND of') or
|
634
|
-
x.startswith('svn: REPORT of') or
|
635
|
-
x.startswith('svn: Unknown hostname') or
|
636
|
-
x.startswith('svn: Server sent unexpected return value') or
|
637
|
-
x.startswith('svn: Can\'t connect to host')):
|
638
|
-
return True
|
639
|
-
return False
|
640
|
-
|
641
|
-
# Subversion client is really misbehaving with Google Code.
|
642
|
-
if args[0] == 'checkout':
|
643
|
-
# Ensure at least one file was checked out, otherwise *delete* the
|
644
|
-
# directory.
|
645
|
-
if len(file_list) == previous_list_len:
|
646
|
-
if not IsKnownFailure():
|
647
|
-
# No known svn error was found, bail out.
|
648
|
-
raise
|
649
|
-
# No file were checked out, so make sure the directory is
|
650
|
-
# deleted in case it's messed up and try again.
|
651
|
-
# Warning: It's bad, it assumes args[2] is the directory
|
652
|
-
# argument.
|
653
|
-
if os.path.isdir(args[2]):
|
654
|
-
gclient_utils.rmtree(args[2])
|
655
|
-
else:
|
656
|
-
# Progress was made, convert to update since an aborted checkout
|
657
|
-
# is now an update.
|
658
|
-
args = ['update'] + args[1:]
|
659
|
-
else:
|
660
|
-
# It was an update or export.
|
661
|
-
# We enforce that some progress has been made or a known failure.
|
662
|
-
if len(file_list) == previous_list_len and not IsKnownFailure():
|
663
|
-
# No known svn error was found and no progress, bail out.
|
664
|
-
raise
|
665
|
-
if retries == 10:
|
666
|
-
raise
|
667
|
-
print "Sleeping %.1f seconds and retrying...." % backoff_time
|
668
|
-
time.sleep(backoff_time)
|
669
|
-
backoff_time *= 1.3
|
670
|
-
continue
|
671
|
-
break
|
672
|
-
|
673
|
-
@staticmethod
|
674
|
-
def CaptureRemoteInfo(url):
|
675
|
-
"""Returns a dictionary from the svn info output for the given url.
|
676
|
-
|
677
|
-
Throws an exception if svn info fails.
|
678
|
-
"""
|
679
|
-
assert isinstance(url, str)
|
680
|
-
return SVN._CaptureInfo([url], None)
|
681
|
-
|
682
|
-
@staticmethod
|
683
|
-
def CaptureLocalInfo(files, cwd):
|
684
|
-
"""Returns a dictionary from the svn info output for the given files.
|
685
|
-
|
686
|
-
Throws an exception if svn info fails.
|
687
|
-
"""
|
688
|
-
assert isinstance(files, (list, tuple))
|
689
|
-
return SVN._CaptureInfo(files, cwd)
|
690
|
-
|
691
|
-
@staticmethod
|
692
|
-
def _CaptureInfo(files, cwd):
|
693
|
-
"""Returns a dictionary from the svn info output for the given file.
|
694
|
-
|
695
|
-
Throws an exception if svn info fails."""
|
696
|
-
result = {}
|
697
|
-
info = ElementTree.XML(SVN.Capture(['info', '--xml'] + files, cwd))
|
698
|
-
if info is None:
|
699
|
-
return result
|
700
|
-
entry = info.find('entry')
|
701
|
-
if entry is None:
|
702
|
-
return result
|
703
|
-
|
704
|
-
# Use .text when the item is not optional.
|
705
|
-
result['Path'] = entry.attrib['path']
|
706
|
-
rev = entry.attrib['revision']
|
707
|
-
try:
|
708
|
-
result['Revision'] = int(rev)
|
709
|
-
except ValueError:
|
710
|
-
result['Revision'] = None
|
711
|
-
result['Node Kind'] = entry.attrib['kind']
|
712
|
-
# Differs across versions.
|
713
|
-
if result['Node Kind'] == 'dir':
|
714
|
-
result['Node Kind'] = 'directory'
|
715
|
-
result['URL'] = entry.find('url').text
|
716
|
-
repository = entry.find('repository')
|
717
|
-
result['Repository Root'] = repository.find('root').text
|
718
|
-
result['UUID'] = repository.find('uuid')
|
719
|
-
wc_info = entry.find('wc-info')
|
720
|
-
if wc_info is not None:
|
721
|
-
result['Schedule'] = wc_info.find('schedule').text
|
722
|
-
result['Copied From URL'] = wc_info.find('copy-from-url')
|
723
|
-
result['Copied From Rev'] = wc_info.find('copy-from-rev')
|
724
|
-
else:
|
725
|
-
result['Schedule'] = None
|
726
|
-
result['Copied From URL'] = None
|
727
|
-
result['Copied From Rev'] = None
|
728
|
-
for key in result.keys():
|
729
|
-
if isinstance(result[key], unicode):
|
730
|
-
# Unicode results interferes with the higher layers matching up things
|
731
|
-
# in the deps dictionary.
|
732
|
-
result[key] = result[key].encode()
|
733
|
-
# Automatic conversion of optional parameters.
|
734
|
-
result[key] = getattr(result[key], 'text', result[key])
|
735
|
-
return result
|
736
|
-
|
737
|
-
@staticmethod
|
738
|
-
def CaptureRevision(cwd):
|
739
|
-
"""Get the base revision of a SVN repository.
|
740
|
-
|
741
|
-
Returns:
|
742
|
-
Int base revision
|
743
|
-
"""
|
744
|
-
return SVN.CaptureLocalInfo([], cwd).get('Revision')
|
745
|
-
|
746
|
-
@staticmethod
|
747
|
-
def CaptureStatus(files, cwd, no_ignore=False):
|
748
|
-
"""Returns the svn 1.5 svn status emulated output.
|
749
|
-
|
750
|
-
@files can be a string (one file) or a list of files.
|
751
|
-
|
752
|
-
Returns an array of (status, file) tuples."""
|
753
|
-
command = ["status", "--xml"]
|
754
|
-
if no_ignore:
|
755
|
-
command.append('--no-ignore')
|
756
|
-
if not files:
|
757
|
-
pass
|
758
|
-
elif isinstance(files, basestring):
|
759
|
-
command.append(files)
|
760
|
-
else:
|
761
|
-
command.extend(files)
|
762
|
-
|
763
|
-
status_letter = {
|
764
|
-
None: ' ',
|
765
|
-
'': ' ',
|
766
|
-
'added': 'A',
|
767
|
-
'conflicted': 'C',
|
768
|
-
'deleted': 'D',
|
769
|
-
'external': 'X',
|
770
|
-
'ignored': 'I',
|
771
|
-
'incomplete': '!',
|
772
|
-
'merged': 'G',
|
773
|
-
'missing': '!',
|
774
|
-
'modified': 'M',
|
775
|
-
'none': ' ',
|
776
|
-
'normal': ' ',
|
777
|
-
'obstructed': '~',
|
778
|
-
'replaced': 'R',
|
779
|
-
'unversioned': '?',
|
780
|
-
}
|
781
|
-
dom = ElementTree.XML(SVN.Capture(command, cwd))
|
782
|
-
results = []
|
783
|
-
if dom is None:
|
784
|
-
return results
|
785
|
-
# /status/target/entry/(wc-status|commit|author|date)
|
786
|
-
for target in dom.findall('target'):
|
787
|
-
for entry in target.findall('entry'):
|
788
|
-
file_path = entry.attrib['path']
|
789
|
-
wc_status = entry.find('wc-status')
|
790
|
-
# Emulate svn 1.5 status ouput...
|
791
|
-
statuses = [' '] * 7
|
792
|
-
# Col 0
|
793
|
-
xml_item_status = wc_status.attrib['item']
|
794
|
-
if xml_item_status in status_letter:
|
795
|
-
statuses[0] = status_letter[xml_item_status]
|
796
|
-
else:
|
797
|
-
raise gclient_utils.Error(
|
798
|
-
'Unknown item status "%s"; please implement me!' %
|
799
|
-
xml_item_status)
|
800
|
-
# Col 1
|
801
|
-
xml_props_status = wc_status.attrib['props']
|
802
|
-
if xml_props_status == 'modified':
|
803
|
-
statuses[1] = 'M'
|
804
|
-
elif xml_props_status == 'conflicted':
|
805
|
-
statuses[1] = 'C'
|
806
|
-
elif (not xml_props_status or xml_props_status == 'none' or
|
807
|
-
xml_props_status == 'normal'):
|
808
|
-
pass
|
809
|
-
else:
|
810
|
-
raise gclient_utils.Error(
|
811
|
-
'Unknown props status "%s"; please implement me!' %
|
812
|
-
xml_props_status)
|
813
|
-
# Col 2
|
814
|
-
if wc_status.attrib.get('wc-locked') == 'true':
|
815
|
-
statuses[2] = 'L'
|
816
|
-
# Col 3
|
817
|
-
if wc_status.attrib.get('copied') == 'true':
|
818
|
-
statuses[3] = '+'
|
819
|
-
# Col 4
|
820
|
-
if wc_status.attrib.get('switched') == 'true':
|
821
|
-
statuses[4] = 'S'
|
822
|
-
# TODO(maruel): Col 5 and 6
|
823
|
-
item = (''.join(statuses), file_path)
|
824
|
-
results.append(item)
|
825
|
-
return results
|
826
|
-
|
827
|
-
@staticmethod
|
828
|
-
def IsMoved(filename, cwd):
|
829
|
-
"""Determine if a file has been added through svn mv"""
|
830
|
-
assert isinstance(filename, basestring)
|
831
|
-
return SVN.IsMovedInfo(SVN.CaptureLocalInfo([filename], cwd))
|
832
|
-
|
833
|
-
@staticmethod
|
834
|
-
def IsMovedInfo(info):
|
835
|
-
"""Determine if a file has been added through svn mv"""
|
836
|
-
return (info.get('Copied From URL') and
|
837
|
-
info.get('Copied From Rev') and
|
838
|
-
info.get('Schedule') == 'add')
|
839
|
-
|
840
|
-
@staticmethod
|
841
|
-
def GetFileProperty(filename, property_name, cwd):
|
842
|
-
"""Returns the value of an SVN property for the given file.
|
843
|
-
|
844
|
-
Args:
|
845
|
-
filename: The file to check
|
846
|
-
property_name: The name of the SVN property, e.g. "svn:mime-type"
|
847
|
-
|
848
|
-
Returns:
|
849
|
-
The value of the property, which will be the empty string if the property
|
850
|
-
is not set on the file. If the file is not under version control, the
|
851
|
-
empty string is also returned.
|
852
|
-
"""
|
853
|
-
try:
|
854
|
-
return SVN.Capture(['propget', property_name, filename], cwd)
|
855
|
-
except subprocess2.CalledProcessError:
|
856
|
-
return ''
|
857
|
-
|
858
|
-
@staticmethod
|
859
|
-
def GenerateDiff(filenames, cwd, full_move, revision):
|
860
|
-
"""Returns a string containing the diff for the given file list.
|
861
|
-
|
862
|
-
The files in the list should either be absolute paths or relative to the
|
863
|
-
given root. If no root directory is provided, the repository root will be
|
864
|
-
used.
|
865
|
-
The diff will always use relative paths.
|
866
|
-
"""
|
867
|
-
assert isinstance(filenames, (list, tuple))
|
868
|
-
# If the user specified a custom diff command in their svn config file,
|
869
|
-
# then it'll be used when we do svn diff, which we don't want to happen
|
870
|
-
# since we want the unified diff.
|
871
|
-
if SVN.AssertVersion("1.7")[0]:
|
872
|
-
# On svn >= 1.7, the "--internal-diff" flag will solve this.
|
873
|
-
return SVN._GenerateDiffInternal(filenames, cwd, full_move, revision,
|
874
|
-
["diff", "--internal-diff"],
|
875
|
-
["diff", "--internal-diff"])
|
876
|
-
else:
|
877
|
-
# On svn < 1.7, the "--internal-diff" flag doesn't exist. Using
|
878
|
-
# --diff-cmd=diff doesn't always work, since e.g. Windows cmd users may
|
879
|
-
# not have a "diff" executable in their path at all. So we use an empty
|
880
|
-
# temporary directory as the config directory, which bypasses any user
|
881
|
-
# settings for the diff-cmd. However, we don't pass this for the
|
882
|
-
# remote_safe_diff_command parameter, since when a new config-dir is
|
883
|
-
# specified for an svn diff against a remote URL, it triggers
|
884
|
-
# authentication prompts. In this case there isn't really a good
|
885
|
-
# alternative to svn 1.7's --internal-diff flag.
|
886
|
-
bogus_dir = tempfile.mkdtemp()
|
887
|
-
try:
|
888
|
-
return SVN._GenerateDiffInternal(filenames, cwd, full_move, revision,
|
889
|
-
["diff", "--config-dir", bogus_dir],
|
890
|
-
["diff"])
|
891
|
-
finally:
|
892
|
-
gclient_utils.rmtree(bogus_dir)
|
893
|
-
|
894
|
-
@staticmethod
|
895
|
-
def _GenerateDiffInternal(filenames, cwd, full_move, revision, diff_command,
|
896
|
-
remote_safe_diff_command):
|
897
|
-
root = os.path.normcase(os.path.join(cwd, ''))
|
898
|
-
def RelativePath(path, root):
|
899
|
-
"""We must use relative paths."""
|
900
|
-
if os.path.normcase(path).startswith(root):
|
901
|
-
return path[len(root):]
|
902
|
-
return path
|
903
|
-
# Cleanup filenames
|
904
|
-
filenames = [RelativePath(f, root) for f in filenames]
|
905
|
-
# Get information about the modified items (files and directories)
|
906
|
-
data = dict((f, SVN.CaptureLocalInfo([f], root)) for f in filenames)
|
907
|
-
diffs = []
|
908
|
-
if full_move:
|
909
|
-
# Eliminate modified files inside moved/copied directory.
|
910
|
-
for (filename, info) in data.iteritems():
|
911
|
-
if SVN.IsMovedInfo(info) and info.get("Node Kind") == "directory":
|
912
|
-
# Remove files inside the directory.
|
913
|
-
filenames = [f for f in filenames
|
914
|
-
if not f.startswith(filename + os.path.sep)]
|
915
|
-
for filename in data.keys():
|
916
|
-
if not filename in filenames:
|
917
|
-
# Remove filtered out items.
|
918
|
-
del data[filename]
|
919
|
-
else:
|
920
|
-
metaheaders = []
|
921
|
-
for (filename, info) in data.iteritems():
|
922
|
-
if SVN.IsMovedInfo(info):
|
923
|
-
# for now, the most common case is a head copy,
|
924
|
-
# so let's just encode that as a straight up cp.
|
925
|
-
srcurl = info.get('Copied From URL')
|
926
|
-
file_root = info.get('Repository Root')
|
927
|
-
rev = int(info.get('Copied From Rev'))
|
928
|
-
assert srcurl.startswith(file_root)
|
929
|
-
src = srcurl[len(file_root)+1:]
|
930
|
-
try:
|
931
|
-
srcinfo = SVN.CaptureRemoteInfo(srcurl)
|
932
|
-
except subprocess2.CalledProcessError, e:
|
933
|
-
if not 'Not a valid URL' in e.stderr:
|
934
|
-
raise
|
935
|
-
# Assume the file was deleted. No idea how to figure out at which
|
936
|
-
# revision the file was deleted.
|
937
|
-
srcinfo = {'Revision': rev}
|
938
|
-
if (srcinfo.get('Revision') != rev and
|
939
|
-
SVN.Capture(remote_safe_diff_command + ['-r', '%d:head' % rev,
|
940
|
-
srcurl], cwd)):
|
941
|
-
metaheaders.append("#$ svn cp -r %d %s %s "
|
942
|
-
"### WARNING: note non-trunk copy\n" %
|
943
|
-
(rev, src, filename))
|
944
|
-
else:
|
945
|
-
metaheaders.append("#$ cp %s %s\n" % (src,
|
946
|
-
filename))
|
947
|
-
if metaheaders:
|
948
|
-
diffs.append("### BEGIN SVN COPY METADATA\n")
|
949
|
-
diffs.extend(metaheaders)
|
950
|
-
diffs.append("### END SVN COPY METADATA\n")
|
951
|
-
# Now ready to do the actual diff.
|
952
|
-
for filename in sorted(data):
|
953
|
-
diffs.append(SVN._DiffItemInternal(
|
954
|
-
filename, cwd, data[filename], diff_command, full_move, revision))
|
955
|
-
# Use StringIO since it can be messy when diffing a directory move with
|
956
|
-
# full_move=True.
|
957
|
-
buf = cStringIO.StringIO()
|
958
|
-
for d in filter(None, diffs):
|
959
|
-
buf.write(d)
|
960
|
-
result = buf.getvalue()
|
961
|
-
buf.close()
|
962
|
-
return result
|
963
|
-
|
964
|
-
@staticmethod
|
965
|
-
def _DiffItemInternal(filename, cwd, info, diff_command, full_move, revision):
|
966
|
-
"""Grabs the diff data."""
|
967
|
-
command = diff_command + [filename]
|
968
|
-
if revision:
|
969
|
-
command.extend(['--revision', revision])
|
970
|
-
data = None
|
971
|
-
if SVN.IsMovedInfo(info):
|
972
|
-
if full_move:
|
973
|
-
if info.get("Node Kind") == "directory":
|
974
|
-
# Things become tricky here. It's a directory copy/move. We need to
|
975
|
-
# diff all the files inside it.
|
976
|
-
# This will put a lot of pressure on the heap. This is why StringIO
|
977
|
-
# is used and converted back into a string at the end. The reason to
|
978
|
-
# return a string instead of a StringIO is that StringIO.write()
|
979
|
-
# doesn't accept a StringIO object. *sigh*.
|
980
|
-
for (dirpath, dirnames, filenames) in os.walk(filename):
|
981
|
-
# Cleanup all files starting with a '.'.
|
982
|
-
for d in dirnames:
|
983
|
-
if d.startswith('.'):
|
984
|
-
dirnames.remove(d)
|
985
|
-
for f in filenames:
|
986
|
-
if f.startswith('.'):
|
987
|
-
filenames.remove(f)
|
988
|
-
for f in filenames:
|
989
|
-
if data is None:
|
990
|
-
data = cStringIO.StringIO()
|
991
|
-
data.write(GenFakeDiff(os.path.join(dirpath, f)))
|
992
|
-
if data:
|
993
|
-
tmp = data.getvalue()
|
994
|
-
data.close()
|
995
|
-
data = tmp
|
996
|
-
else:
|
997
|
-
data = GenFakeDiff(filename)
|
998
|
-
else:
|
999
|
-
if info.get("Node Kind") != "directory":
|
1000
|
-
# svn diff on a mv/cp'd file outputs nothing if there was no change.
|
1001
|
-
data = SVN.Capture(command, cwd)
|
1002
|
-
if not data:
|
1003
|
-
# We put in an empty Index entry so upload.py knows about them.
|
1004
|
-
data = "Index: %s\n" % filename.replace(os.sep, '/')
|
1005
|
-
# Otherwise silently ignore directories.
|
1006
|
-
else:
|
1007
|
-
if info.get("Node Kind") != "directory":
|
1008
|
-
# Normal simple case.
|
1009
|
-
try:
|
1010
|
-
data = SVN.Capture(command, cwd)
|
1011
|
-
except subprocess2.CalledProcessError:
|
1012
|
-
if revision:
|
1013
|
-
data = GenFakeDiff(filename)
|
1014
|
-
else:
|
1015
|
-
raise
|
1016
|
-
# Otherwise silently ignore directories.
|
1017
|
-
return data
|
1018
|
-
|
1019
|
-
@staticmethod
|
1020
|
-
def GetEmail(cwd):
|
1021
|
-
"""Retrieves the svn account which we assume is an email address."""
|
1022
|
-
try:
|
1023
|
-
infos = SVN.CaptureLocalInfo([], cwd)
|
1024
|
-
except subprocess2.CalledProcessError:
|
1025
|
-
return None
|
1026
|
-
|
1027
|
-
# Should check for uuid but it is incorrectly saved for https creds.
|
1028
|
-
root = infos['Repository Root']
|
1029
|
-
realm = root.rsplit('/', 1)[0]
|
1030
|
-
uuid = infos['UUID']
|
1031
|
-
if root.startswith('https') or not uuid:
|
1032
|
-
regexp = re.compile(r'<%s:\d+>.*' % realm)
|
1033
|
-
else:
|
1034
|
-
regexp = re.compile(r'<%s:\d+> %s' % (realm, uuid))
|
1035
|
-
if regexp is None:
|
1036
|
-
return None
|
1037
|
-
if sys.platform.startswith('win'):
|
1038
|
-
if not 'APPDATA' in os.environ:
|
1039
|
-
return None
|
1040
|
-
auth_dir = os.path.join(os.environ['APPDATA'], 'Subversion', 'auth',
|
1041
|
-
'svn.simple')
|
1042
|
-
else:
|
1043
|
-
auth_dir = os.path.expanduser(
|
1044
|
-
os.path.join('~', '.subversion', 'auth', 'svn.simple'))
|
1045
|
-
if not os.path.exists(auth_dir):
|
1046
|
-
return None
|
1047
|
-
for credfile in os.listdir(auth_dir):
|
1048
|
-
cred_info = SVN.ReadSimpleAuth(os.path.join(auth_dir, credfile))
|
1049
|
-
if regexp.match(cred_info.get('svn:realmstring')):
|
1050
|
-
return cred_info.get('username')
|
1051
|
-
|
1052
|
-
@staticmethod
|
1053
|
-
def ReadSimpleAuth(filename):
|
1054
|
-
f = open(filename, 'r')
|
1055
|
-
values = {}
|
1056
|
-
def ReadOneItem(item_type):
|
1057
|
-
m = re.match(r'%s (\d+)' % item_type, f.readline())
|
1058
|
-
if not m:
|
1059
|
-
return None
|
1060
|
-
data = f.read(int(m.group(1)))
|
1061
|
-
if f.read(1) != '\n':
|
1062
|
-
return None
|
1063
|
-
return data
|
1064
|
-
|
1065
|
-
while True:
|
1066
|
-
key = ReadOneItem('K')
|
1067
|
-
if not key:
|
1068
|
-
break
|
1069
|
-
value = ReadOneItem('V')
|
1070
|
-
if not value:
|
1071
|
-
break
|
1072
|
-
values[key] = value
|
1073
|
-
return values
|
1074
|
-
|
1075
|
-
@staticmethod
|
1076
|
-
def GetCheckoutRoot(cwd):
|
1077
|
-
"""Returns the top level directory of the current repository.
|
1078
|
-
|
1079
|
-
The directory is returned as an absolute path.
|
1080
|
-
"""
|
1081
|
-
cwd = os.path.abspath(cwd)
|
1082
|
-
try:
|
1083
|
-
info = SVN.CaptureLocalInfo([], cwd)
|
1084
|
-
cur_dir_repo_root = info['Repository Root']
|
1085
|
-
url = info['URL']
|
1086
|
-
except subprocess2.CalledProcessError:
|
1087
|
-
return None
|
1088
|
-
while True:
|
1089
|
-
parent = os.path.dirname(cwd)
|
1090
|
-
try:
|
1091
|
-
info = SVN.CaptureLocalInfo([], parent)
|
1092
|
-
if (info['Repository Root'] != cur_dir_repo_root or
|
1093
|
-
info['URL'] != os.path.dirname(url)):
|
1094
|
-
break
|
1095
|
-
url = info['URL']
|
1096
|
-
except subprocess2.CalledProcessError:
|
1097
|
-
break
|
1098
|
-
cwd = parent
|
1099
|
-
return GetCasedPath(cwd)
|
1100
|
-
|
1101
|
-
@staticmethod
|
1102
|
-
def IsValidRevision(url):
|
1103
|
-
"""Verifies the revision looks like an SVN revision."""
|
1104
|
-
try:
|
1105
|
-
SVN.Capture(['info', url], cwd=None)
|
1106
|
-
return True
|
1107
|
-
except subprocess2.CalledProcessError:
|
1108
|
-
return False
|
1109
|
-
|
1110
|
-
@classmethod
|
1111
|
-
def AssertVersion(cls, min_version):
|
1112
|
-
"""Asserts svn's version is at least min_version."""
|
1113
|
-
if cls.current_version is None:
|
1114
|
-
cls.current_version = cls.Capture(['--version', '--quiet'], None)
|
1115
|
-
current_version_list = map(only_int, cls.current_version.split('.'))
|
1116
|
-
for min_ver in map(int, min_version.split('.')):
|
1117
|
-
ver = current_version_list.pop(0)
|
1118
|
-
if ver < min_ver:
|
1119
|
-
return (False, cls.current_version)
|
1120
|
-
elif ver > min_ver:
|
1121
|
-
return (True, cls.current_version)
|
1122
|
-
return (True, cls.current_version)
|
1123
|
-
|
1124
|
-
@staticmethod
|
1125
|
-
def Revert(cwd, callback=None, ignore_externals=False, no_ignore=False):
|
1126
|
-
"""Reverts all svn modifications in cwd, including properties.
|
1127
|
-
|
1128
|
-
Deletes any modified files or directory.
|
1129
|
-
|
1130
|
-
A "svn update --revision BASE" call is required after to revive deleted
|
1131
|
-
files.
|
1132
|
-
"""
|
1133
|
-
for file_status in SVN.CaptureStatus(None, cwd, no_ignore=no_ignore):
|
1134
|
-
file_path = os.path.join(cwd, file_status[1])
|
1135
|
-
if (ignore_externals and
|
1136
|
-
file_status[0][0] == 'X' and
|
1137
|
-
file_status[0][1:].isspace()):
|
1138
|
-
# Ignore externals.
|
1139
|
-
logging.info('Ignoring external %s' % file_status[1])
|
1140
|
-
continue
|
1141
|
-
|
1142
|
-
# This is the case where '! L .' is returned by 'svn status'. Just
|
1143
|
-
# strip off the '/.'.
|
1144
|
-
if file_path.endswith(os.path.sep + '.'):
|
1145
|
-
file_path = file_path[:-2]
|
1146
|
-
|
1147
|
-
if callback:
|
1148
|
-
callback(file_status)
|
1149
|
-
|
1150
|
-
if os.path.exists(file_path):
|
1151
|
-
# svn revert is really stupid. It fails on inconsistent line-endings,
|
1152
|
-
# on switched directories, etc. So take no chance and delete everything!
|
1153
|
-
# In theory, it wouldn't be necessary for property-only change but then
|
1154
|
-
# it'd have to look for switched directories, etc so it's not worth
|
1155
|
-
# optimizing this use case.
|
1156
|
-
if os.path.isfile(file_path) or os.path.islink(file_path):
|
1157
|
-
logging.info('os.remove(%s)' % file_path)
|
1158
|
-
os.remove(file_path)
|
1159
|
-
elif os.path.isdir(file_path):
|
1160
|
-
logging.info('rmtree(%s)' % file_path)
|
1161
|
-
gclient_utils.rmtree(file_path)
|
1162
|
-
else:
|
1163
|
-
logging.critical(
|
1164
|
-
('No idea what is %s.\nYou just found a bug in gclient'
|
1165
|
-
', please ping maruel@chromium.org ASAP!') % file_path)
|
1166
|
-
|
1167
|
-
if (file_status[0][0] in ('D', 'A', '!') or
|
1168
|
-
not file_status[0][1:].isspace()):
|
1169
|
-
# Added, deleted file requires manual intervention and require calling
|
1170
|
-
# revert, like for properties.
|
1171
|
-
if not os.path.isdir(cwd):
|
1172
|
-
# '.' was deleted. It's not worth continuing.
|
1173
|
-
return
|
1174
|
-
try:
|
1175
|
-
SVN.Capture(['revert', file_status[1]], cwd=cwd)
|
1176
|
-
except subprocess2.CalledProcessError:
|
1177
|
-
if not os.path.exists(file_path):
|
1178
|
-
continue
|
1179
|
-
raise
|