libv8 5.3.332.38.5 → 5.6.326.50.0beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (352) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -1
  3. data/CHANGELOG.md +2 -0
  4. data/ext/libv8/builder.rb +2 -2
  5. data/lib/libv8/version.rb +1 -1
  6. data/patches/0001-Build-a-standalone-static-library.patch +4 -4
  7. data/patches/0002-Don-t-compile-unnecessary-stuff.patch +16 -11
  8. data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +4 -4
  9. data/patches/{0005-Do-not-embed-debug-symbols-in-macOS-libraries.patch → 0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch} +4 -4
  10. data/vendor/depot_tools/.gitignore +4 -0
  11. data/vendor/depot_tools/OWNERS +0 -2
  12. data/vendor/depot_tools/PRESUBMIT.py +20 -23
  13. data/vendor/depot_tools/README.gclient.md +3 -3
  14. data/vendor/depot_tools/README.git-cl.md +13 -12
  15. data/vendor/depot_tools/README.md +2 -3
  16. data/vendor/depot_tools/WATCHLISTS +0 -1
  17. data/vendor/depot_tools/appengine_mapper.py +23 -0
  18. data/vendor/depot_tools/apply_issue.py +2 -8
  19. data/vendor/depot_tools/bootstrap/win/README.md +1 -8
  20. data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +6 -16
  21. data/vendor/depot_tools/bootstrap/win/git_version.txt +1 -1
  22. data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +1 -1
  23. data/vendor/depot_tools/checkout.py +20 -433
  24. data/vendor/depot_tools/cipd +73 -0
  25. data/vendor/depot_tools/cipd.bat +12 -0
  26. data/vendor/depot_tools/cipd.ps1 +57 -0
  27. data/vendor/depot_tools/cipd_client_version +1 -0
  28. data/vendor/depot_tools/clang_format.py +9 -6
  29. data/vendor/depot_tools/clang_format_merge_driver +8 -0
  30. data/vendor/depot_tools/clang_format_merge_driver.bat +11 -0
  31. data/vendor/depot_tools/clang_format_merge_driver.py +67 -0
  32. data/vendor/depot_tools/codereview.settings +3 -2
  33. data/vendor/depot_tools/commit_queue.py +1 -1
  34. data/vendor/depot_tools/cpplint.py +2 -0
  35. data/vendor/depot_tools/fetch.py +1 -54
  36. data/vendor/depot_tools/fetch_configs/android.py +2 -2
  37. data/vendor/depot_tools/fetch_configs/breakpad.py +2 -3
  38. data/vendor/depot_tools/fetch_configs/chromium.py +2 -3
  39. data/vendor/depot_tools/fetch_configs/crashpad.py +2 -2
  40. data/vendor/depot_tools/fetch_configs/dart.py +2 -3
  41. data/vendor/depot_tools/fetch_configs/dartino.py +2 -3
  42. data/vendor/depot_tools/fetch_configs/dartium.py +2 -3
  43. data/vendor/depot_tools/fetch_configs/depot_tools.py +3 -6
  44. data/vendor/depot_tools/fetch_configs/gyp.py +2 -3
  45. data/vendor/depot_tools/fetch_configs/infra.py +2 -2
  46. data/vendor/depot_tools/fetch_configs/infra_internal.py +2 -2
  47. data/vendor/depot_tools/fetch_configs/ios.py +2 -2
  48. data/vendor/depot_tools/fetch_configs/ios_internal.py +2 -3
  49. data/vendor/depot_tools/fetch_configs/mojo.py +2 -3
  50. data/vendor/depot_tools/fetch_configs/nacl.py +2 -3
  51. data/vendor/depot_tools/fetch_configs/naclports.py +2 -3
  52. data/vendor/depot_tools/fetch_configs/pdfium.py +2 -2
  53. data/vendor/depot_tools/fetch_configs/skia.py +2 -2
  54. data/vendor/depot_tools/fetch_configs/skia_buildbot.py +2 -2
  55. data/vendor/depot_tools/fetch_configs/syzygy.py +2 -2
  56. data/vendor/depot_tools/fetch_configs/v8.py +2 -3
  57. data/vendor/depot_tools/fetch_configs/webrtc.py +5 -3
  58. data/vendor/depot_tools/fetch_configs/webrtc_android.py +2 -2
  59. data/vendor/depot_tools/fetch_configs/webrtc_ios.py +2 -2
  60. data/vendor/depot_tools/fix_encoding.py +6 -6
  61. data/vendor/depot_tools/gclient.py +136 -368
  62. data/vendor/depot_tools/gclient_scm.py +108 -647
  63. data/vendor/depot_tools/gclient_utils.py +22 -86
  64. data/vendor/depot_tools/gerrit_client.py +105 -0
  65. data/vendor/depot_tools/gerrit_util.py +174 -67
  66. data/vendor/depot_tools/git-crrev-parse +6 -7
  67. data/vendor/depot_tools/git-gs +1 -1
  68. data/vendor/depot_tools/git_cache.py +68 -18
  69. data/vendor/depot_tools/git_cherry_pick_upload.py +4 -4
  70. data/vendor/depot_tools/git_cl.py +1028 -961
  71. data/vendor/depot_tools/git_common.py +2 -3
  72. data/vendor/depot_tools/git_drover.py +0 -1
  73. data/vendor/depot_tools/git_footers.py +3 -43
  74. data/vendor/depot_tools/git_rebase_update.py +9 -1
  75. data/vendor/depot_tools/git_squash_branch.py +1 -1
  76. data/vendor/depot_tools/infra/config/cq.cfg +8 -1
  77. data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
  78. data/vendor/depot_tools/man/html/depot_tools.html +3 -11
  79. data/vendor/depot_tools/man/html/depot_tools_tutorial.html +9 -9
  80. data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +2 -2
  81. data/vendor/depot_tools/man/html/git-drover.html +17 -17
  82. data/vendor/depot_tools/man/html/git-footers.html +2 -2
  83. data/vendor/depot_tools/man/html/git-freeze.html +4 -4
  84. data/vendor/depot_tools/man/html/git-hyper-blame.html +2 -2
  85. data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
  86. data/vendor/depot_tools/man/html/git-map.html +2 -2
  87. data/vendor/depot_tools/man/html/git-mark-merge-base.html +2 -2
  88. data/vendor/depot_tools/man/html/git-nav-downstream.html +2 -2
  89. data/vendor/depot_tools/man/html/git-nav-upstream.html +2 -2
  90. data/vendor/depot_tools/man/html/git-new-branch.html +2 -2
  91. data/vendor/depot_tools/man/html/git-rebase-update.html +2 -2
  92. data/vendor/depot_tools/man/html/git-rename-branch.html +2 -2
  93. data/vendor/depot_tools/man/html/git-reparent-branch.html +2 -2
  94. data/vendor/depot_tools/man/html/git-retry.html +3 -3
  95. data/vendor/depot_tools/man/html/git-squash-branch.html +3 -3
  96. data/vendor/depot_tools/man/html/git-thaw.html +2 -2
  97. data/vendor/depot_tools/man/html/git-upstream-diff.html +3 -3
  98. data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +4 -4
  99. data/vendor/depot_tools/man/man1/git-drover.1 +19 -19
  100. data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
  101. data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
  102. data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
  103. data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
  104. data/vendor/depot_tools/man/man1/git-map.1 +4 -4
  105. data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
  106. data/vendor/depot_tools/man/man1/git-nav-downstream.1 +4 -4
  107. data/vendor/depot_tools/man/man1/git-nav-upstream.1 +4 -4
  108. data/vendor/depot_tools/man/man1/git-new-branch.1 +4 -4
  109. data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -4
  110. data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
  111. data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
  112. data/vendor/depot_tools/man/man1/git-retry.1 +5 -5
  113. data/vendor/depot_tools/man/man1/git-squash-branch.1 +5 -5
  114. data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
  115. data/vendor/depot_tools/man/man1/git-upstream-diff.1 +5 -5
  116. data/vendor/depot_tools/man/man7/depot_tools.7 +5 -10
  117. data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +4 -4
  118. data/vendor/depot_tools/man/src/depot_tools.txt +1 -1
  119. data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +7 -7
  120. data/vendor/depot_tools/man/src/filter_demo_output.py +2 -2
  121. data/vendor/depot_tools/man/src/git-footers.demo.1.sh +1 -1
  122. data/vendor/depot_tools/man/src/git-retry.txt +1 -1
  123. data/vendor/depot_tools/man/src/git-squash-branch.txt +2 -2
  124. data/vendor/depot_tools/man/src/git-upstream-diff.txt +1 -1
  125. data/vendor/depot_tools/my_activity.py +6 -3
  126. data/vendor/depot_tools/my_reviews.py +1 -1
  127. data/vendor/depot_tools/ninja +2 -2
  128. data/vendor/depot_tools/ninja-linux32 +0 -0
  129. data/vendor/depot_tools/ninja-linux64 +0 -0
  130. data/vendor/depot_tools/ninja-mac +0 -0
  131. data/vendor/depot_tools/ninja.exe +0 -0
  132. data/vendor/depot_tools/owners.py +14 -3
  133. data/vendor/depot_tools/presubmit_canned_checks.py +46 -67
  134. data/vendor/depot_tools/presubmit_support.py +109 -371
  135. data/vendor/depot_tools/pylintrc +83 -56
  136. data/vendor/depot_tools/recipe_modules/OWNERS +1 -0
  137. data/vendor/depot_tools/recipe_modules/bot_update/__init__.py +18 -9
  138. data/vendor/depot_tools/recipe_modules/bot_update/api.py +56 -55
  139. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +3 -7
  140. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +3 -7
  141. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +3 -7
  142. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/buildbot.json +52 -0
  143. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +19 -10
  144. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +19 -10
  145. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +19 -10
  146. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +19 -10
  147. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +19 -10
  148. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +3 -7
  149. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +2 -54
  150. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +56 -0
  151. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/{forced.json → trychange_oauth2_json.json} +6 -9
  152. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +54 -0
  153. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +9 -9
  154. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +9 -9
  155. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +9 -9
  156. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +9 -9
  157. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +20 -10
  158. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +59 -0
  159. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +9 -9
  160. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +20 -10
  161. data/vendor/depot_tools/recipe_modules/bot_update/example.py +45 -63
  162. data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +210 -807
  163. data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +34 -45
  164. data/vendor/depot_tools/recipe_modules/cipd/api.py +59 -84
  165. data/vendor/depot_tools/recipe_modules/cipd/example.expected/basic.json +71 -117
  166. data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-failed.json +14 -60
  167. data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-many-instances.json +71 -117
  168. data/vendor/depot_tools/recipe_modules/cipd/example.expected/mac64.json +71 -117
  169. data/vendor/depot_tools/recipe_modules/cipd/example.expected/win64.json +71 -117
  170. data/vendor/depot_tools/recipe_modules/cipd/example.py +2 -12
  171. data/vendor/depot_tools/recipe_modules/cipd/test_api.py +0 -9
  172. data/vendor/depot_tools/recipe_modules/depot_tools/api.py +6 -0
  173. data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/basic.json +7 -0
  174. data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/win.json +7 -0
  175. data/vendor/depot_tools/recipe_modules/depot_tools/example.py +3 -0
  176. data/vendor/depot_tools/recipe_modules/gclient/__init__.py +4 -0
  177. data/vendor/depot_tools/recipe_modules/gclient/api.py +9 -22
  178. data/vendor/depot_tools/recipe_modules/gclient/config.py +18 -5
  179. data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +14 -14
  180. data/vendor/depot_tools/recipe_modules/gclient/example.expected/buildbot.json +211 -0
  181. data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +16 -14
  182. data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +16 -14
  183. data/vendor/depot_tools/recipe_modules/gclient/example.py +13 -11
  184. data/vendor/depot_tools/recipe_modules/gerrit/__init__.py +6 -0
  185. data/vendor/depot_tools/recipe_modules/gerrit/api.py +63 -0
  186. data/vendor/depot_tools/recipe_modules/gerrit/example.expected/basic.json +64 -0
  187. data/vendor/depot_tools/recipe_modules/gerrit/example.py +35 -0
  188. data/vendor/depot_tools/recipe_modules/gerrit/test_api.py +24 -0
  189. data/vendor/depot_tools/recipe_modules/git/__init__.py +4 -0
  190. data/vendor/depot_tools/recipe_modules/git/api.py +155 -142
  191. data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +43 -17
  192. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +43 -17
  193. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +43 -17
  194. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +43 -17
  195. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +43 -17
  196. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +43 -17
  197. data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +13 -13
  198. data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +43 -17
  199. data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +45 -19
  200. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +45 -19
  201. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +43 -17
  202. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +43 -17
  203. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +8 -8
  204. data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +44 -18
  205. data/vendor/depot_tools/recipe_modules/git/example.expected/git-cache-checkout.json +48 -22
  206. data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +43 -17
  207. data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +42 -16
  208. data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +43 -17
  209. data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +43 -17
  210. data/vendor/depot_tools/recipe_modules/git/example.py +9 -3
  211. data/vendor/depot_tools/recipe_modules/git_cl/__init__.py +4 -0
  212. data/vendor/depot_tools/recipe_modules/git_cl/api.py +8 -8
  213. data/vendor/depot_tools/recipe_modules/git_cl/example.py +1 -1
  214. data/vendor/depot_tools/recipe_modules/gsutil/__init__.py +4 -0
  215. data/vendor/depot_tools/recipe_modules/gsutil/api.py +196 -0
  216. data/vendor/depot_tools/recipe_modules/gsutil/example.expected/basic.json +186 -0
  217. data/vendor/depot_tools/recipe_modules/gsutil/example.py +77 -0
  218. data/vendor/depot_tools/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
  219. data/vendor/depot_tools/recipe_modules/infra_paths/__init__.py +3 -0
  220. data/vendor/depot_tools/recipe_modules/infra_paths/api.py +20 -3
  221. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/basic.json +3 -1
  222. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +3 -1
  223. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +3 -1
  224. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +3 -1
  225. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +3 -1
  226. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +3 -1
  227. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +3 -1
  228. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json +3 -1
  229. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json +3 -1
  230. data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json +3 -1
  231. data/vendor/depot_tools/recipe_modules/infra_paths/example.py +6 -1
  232. data/vendor/depot_tools/recipe_modules/infra_paths/path_config.py +4 -6
  233. data/vendor/depot_tools/recipe_modules/rietveld/__init__.py +5 -0
  234. data/vendor/depot_tools/recipe_modules/rietveld/api.py +12 -9
  235. data/vendor/depot_tools/recipe_modules/rietveld/example.expected/basic.json +2 -24
  236. data/vendor/depot_tools/recipe_modules/rietveld/example.expected/buildbot.json +30 -0
  237. data/vendor/depot_tools/recipe_modules/rietveld/example.py +12 -6
  238. data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +4 -0
  239. data/vendor/depot_tools/recipe_modules/tryserver/api.py +46 -70
  240. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/set_failure_hash_with_no_steps.json +8 -0
  241. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/{with_svn_patch.json → with_gerrit_patch.json} +1 -31
  242. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_gerrit_patch_deprecated.json +39 -0
  243. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch.json +2 -2
  244. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch_luci.json +8 -0
  245. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +3 -3
  246. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +3 -3
  247. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +1 -1
  248. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +1 -1
  249. data/vendor/depot_tools/recipe_modules/tryserver/example.py +35 -5
  250. data/vendor/depot_tools/recipes.py +52 -28
  251. data/vendor/depot_tools/repo +216 -69
  252. data/vendor/depot_tools/rietveld.py +20 -15
  253. data/vendor/depot_tools/roll_dep.py +1 -1
  254. data/vendor/depot_tools/scm.py +11 -826
  255. data/vendor/depot_tools/subprocess2.py +5 -5
  256. data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +2 -0
  257. data/vendor/depot_tools/third_party/cq_client/README.md +5 -1
  258. data/vendor/depot_tools/third_party/cq_client/cq.pb.go +183 -104
  259. data/vendor/depot_tools/third_party/cq_client/cq.proto +43 -27
  260. data/vendor/depot_tools/third_party/cq_client/cq_pb2.py +95 -29
  261. data/vendor/depot_tools/third_party/cq_client/testdata/cq_both.cfg +67 -0
  262. data/vendor/depot_tools/third_party/cq_client/testdata/cq_gerrit.cfg +1 -2
  263. data/vendor/depot_tools/third_party/cq_client/testdata/cq_rietveld.cfg +0 -3
  264. data/vendor/depot_tools/third_party/upload.py +44 -24
  265. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +0 -5
  266. metadata +38 -93
  267. data/patches/0004-Reinterpret-thread-hash-for-FreeBSD-too.patch +0 -25
  268. data/vendor/depot_tools/git-auto-svn +0 -6
  269. data/vendor/depot_tools/git_auto_svn.py +0 -122
  270. data/vendor/depot_tools/man/html/git-auto-svn.html +0 -837
  271. data/vendor/depot_tools/man/man1/git-auto-svn.1 +0 -113
  272. data/vendor/depot_tools/man/src/_git-auto-svn_desc.helper.txt +0 -1
  273. data/vendor/depot_tools/man/src/git-auto-svn.txt +0 -69
  274. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +0 -43
  275. data/vendor/depot_tools/recipe_modules/cipd/example.expected/install-failed.json +0 -31
  276. data/vendor/depot_tools/recipe_modules/cipd/resources/bootstrap.py +0 -218
  277. data/vendor/depot_tools/recipe_modules/tryserver/test_api.py +0 -7
  278. data/vendor/depot_tools/third_party/gsutil/CHECKSUM +0 -1
  279. data/vendor/depot_tools/third_party/gsutil/COPYING +0 -202
  280. data/vendor/depot_tools/third_party/gsutil/LICENSE.third_party +0 -295
  281. data/vendor/depot_tools/third_party/gsutil/MANIFEST.in +0 -5
  282. data/vendor/depot_tools/third_party/gsutil/README +0 -38
  283. data/vendor/depot_tools/third_party/gsutil/README.chromium +0 -25
  284. data/vendor/depot_tools/third_party/gsutil/README.pkg +0 -49
  285. data/vendor/depot_tools/third_party/gsutil/ReleaseNotes.txt +0 -825
  286. data/vendor/depot_tools/third_party/gsutil/VERSION +0 -1
  287. data/vendor/depot_tools/third_party/gsutil/gslib/README +0 -5
  288. data/vendor/depot_tools/third_party/gsutil/gslib/__init__.py +0 -22
  289. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/__init__.py +0 -15
  290. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/acls.py +0 -234
  291. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/anon.py +0 -57
  292. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/command_opts.py +0 -116
  293. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/dev.py +0 -139
  294. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/metadata.py +0 -186
  295. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/naming.py +0 -173
  296. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/prod.py +0 -160
  297. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/projects.py +0 -130
  298. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/subdirs.py +0 -110
  299. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/support.py +0 -86
  300. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/versioning.py +0 -242
  301. data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/wildcards.py +0 -170
  302. data/vendor/depot_tools/third_party/gsutil/gslib/bucket_listing_ref.py +0 -175
  303. data/vendor/depot_tools/third_party/gsutil/gslib/command.py +0 -725
  304. data/vendor/depot_tools/third_party/gsutil/gslib/command_runner.py +0 -102
  305. data/vendor/depot_tools/third_party/gsutil/gslib/commands/__init__.py +0 -15
  306. data/vendor/depot_tools/third_party/gsutil/gslib/commands/cat.py +0 -131
  307. data/vendor/depot_tools/third_party/gsutil/gslib/commands/chacl.py +0 -523
  308. data/vendor/depot_tools/third_party/gsutil/gslib/commands/config.py +0 -662
  309. data/vendor/depot_tools/third_party/gsutil/gslib/commands/cp.py +0 -1819
  310. data/vendor/depot_tools/third_party/gsutil/gslib/commands/disablelogging.py +0 -101
  311. data/vendor/depot_tools/third_party/gsutil/gslib/commands/enablelogging.py +0 -149
  312. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getacl.py +0 -82
  313. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getcors.py +0 -121
  314. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getdefacl.py +0 -86
  315. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getlogging.py +0 -137
  316. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getversioning.py +0 -116
  317. data/vendor/depot_tools/third_party/gsutil/gslib/commands/getwebcfg.py +0 -122
  318. data/vendor/depot_tools/third_party/gsutil/gslib/commands/help.py +0 -218
  319. data/vendor/depot_tools/third_party/gsutil/gslib/commands/ls.py +0 -578
  320. data/vendor/depot_tools/third_party/gsutil/gslib/commands/mb.py +0 -172
  321. data/vendor/depot_tools/third_party/gsutil/gslib/commands/mv.py +0 -159
  322. data/vendor/depot_tools/third_party/gsutil/gslib/commands/perfdiag.py +0 -903
  323. data/vendor/depot_tools/third_party/gsutil/gslib/commands/rb.py +0 -113
  324. data/vendor/depot_tools/third_party/gsutil/gslib/commands/rm.py +0 -237
  325. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setacl.py +0 -138
  326. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setcors.py +0 -145
  327. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setdefacl.py +0 -105
  328. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setmeta.py +0 -420
  329. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setversioning.py +0 -114
  330. data/vendor/depot_tools/third_party/gsutil/gslib/commands/setwebcfg.py +0 -190
  331. data/vendor/depot_tools/third_party/gsutil/gslib/commands/update.py +0 -305
  332. data/vendor/depot_tools/third_party/gsutil/gslib/commands/version.py +0 -150
  333. data/vendor/depot_tools/third_party/gsutil/gslib/exception.py +0 -76
  334. data/vendor/depot_tools/third_party/gsutil/gslib/help_provider.py +0 -81
  335. data/vendor/depot_tools/third_party/gsutil/gslib/name_expansion.py +0 -550
  336. data/vendor/depot_tools/third_party/gsutil/gslib/no_op_auth_plugin.py +0 -30
  337. data/vendor/depot_tools/third_party/gsutil/gslib/plurality_checkable_iterator.py +0 -56
  338. data/vendor/depot_tools/third_party/gsutil/gslib/project_id.py +0 -67
  339. data/vendor/depot_tools/third_party/gsutil/gslib/storage_uri_builder.py +0 -56
  340. data/vendor/depot_tools/third_party/gsutil/gslib/thread_pool.py +0 -79
  341. data/vendor/depot_tools/third_party/gsutil/gslib/util.py +0 -167
  342. data/vendor/depot_tools/third_party/gsutil/gslib/wildcard_iterator.py +0 -498
  343. data/vendor/depot_tools/third_party/gsutil/gsutil +0 -384
  344. data/vendor/depot_tools/third_party/gsutil/gsutil.spec.in +0 -75
  345. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/__init__.py +0 -22
  346. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client.py +0 -630
  347. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client_test.py +0 -374
  348. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_helper.py +0 -103
  349. data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_plugin.py +0 -24
  350. data/vendor/depot_tools/third_party/gsutil/pkg_util.py +0 -60
  351. data/vendor/depot_tools/third_party/gsutil/plugins/__init__.py +0 -0
  352. data/vendor/depot_tools/third_party/gsutil/plugins/sso_auth.py +0 -105
@@ -37,14 +37,14 @@ class NoUsableRevError(gclient_utils.Error):
37
37
  class DiffFiltererWrapper(object):
38
38
  """Simple base class which tracks which file is being diffed and
39
39
  replaces instances of its file name in the original and
40
- working copy lines of the svn/git diff output."""
40
+ working copy lines of the git diff output."""
41
41
  index_string = None
42
42
  original_prefix = "--- "
43
43
  working_prefix = "+++ "
44
44
 
45
45
  def __init__(self, relpath, print_func):
46
46
  # Note that we always use '/' as the path separator to be
47
- # consistent with svn's cygwin-style output on Windows
47
+ # consistent with cygwin-style output on Windows
48
48
  self._relpath = relpath.replace("\\", "/")
49
49
  self._current_file = None
50
50
  self._print_func = print_func
@@ -70,10 +70,6 @@ class DiffFiltererWrapper(object):
70
70
  self._print_func(line)
71
71
 
72
72
 
73
- class SvnDiffFilterer(DiffFiltererWrapper):
74
- index_string = "Index: "
75
-
76
-
77
73
  class GitDiffFilterer(DiffFiltererWrapper):
78
74
  index_string = "diff --git "
79
75
 
@@ -90,26 +86,20 @@ class GitDiffFilterer(DiffFiltererWrapper):
90
86
  # Factory Method for SCM wrapper creation
91
87
 
92
88
  def GetScmName(url):
93
- if url:
94
- url, _ = gclient_utils.SplitUrlRevision(url)
95
- if (url.startswith('git://') or url.startswith('ssh://') or
96
- url.startswith('git+http://') or url.startswith('git+https://') or
97
- url.endswith('.git') or url.startswith('sso://') or
98
- 'googlesource' in url):
99
- return 'git'
100
- elif (url.startswith('http://') or url.startswith('https://') or
101
- url.startswith('svn://') or url.startswith('svn+ssh://')):
102
- return 'svn'
103
- elif url.startswith('file://'):
104
- if url.endswith('.git'):
105
- return 'git'
106
- return 'svn'
89
+ if not url:
90
+ return None
91
+ url, _ = gclient_utils.SplitUrlRevision(url)
92
+ if url.endswith('.git'):
93
+ return 'git'
94
+ protocol = url.split('://')[0]
95
+ if protocol in (
96
+ 'file', 'git', 'git+http', 'git+https', 'http', 'https', 'ssh', 'sso'):
97
+ return 'git'
107
98
  return None
108
99
 
109
100
 
110
101
  def CreateSCM(url, root_dir=None, relpath=None, out_fh=None, out_cb=None):
111
102
  SCM_MAP = {
112
- 'svn' : SVNWrapper,
113
103
  'git' : GitWrapper,
114
104
  }
115
105
 
@@ -153,7 +143,7 @@ class SCMWrapper(object):
153
143
  print(*args, **kwargs)
154
144
 
155
145
  def RunCommand(self, command, options, args, file_list=None):
156
- commands = ['cleanup', 'update', 'updatesingle', 'revert',
146
+ commands = ['update', 'updatesingle', 'revert',
157
147
  'revinfo', 'status', 'diff', 'pack', 'runhooks']
158
148
 
159
149
  if not command in commands:
@@ -192,10 +182,6 @@ class SCMWrapper(object):
192
182
  actual_remote_url.replace('\\', '/')):
193
183
  actual_remote_url = self._get_first_remote_url(mirror.mirror_path)
194
184
  return actual_remote_url
195
-
196
- # Svn
197
- if os.path.exists(os.path.join(self.checkout_path, '.svn')):
198
- return scm.SVN.CaptureLocalInfo([], self.checkout_path)['URL']
199
185
  return None
200
186
 
201
187
  def DoesRemoteURLMatch(self, options):
@@ -210,7 +196,7 @@ class SCMWrapper(object):
210
196
  == gclient_utils.SplitUrlRevision(self.url)[0].rstrip('/'))
211
197
  else:
212
198
  # This may occur if the self.checkout_path exists but does not contain a
213
- # valid git or svn checkout.
199
+ # valid git checkout.
214
200
  return False
215
201
 
216
202
  def _DeleteOrMove(self, force):
@@ -284,13 +270,6 @@ class GitWrapper(SCMWrapper):
284
270
  # time-stamp of the currently checked out revision.
285
271
  return self._Capture(['log', '-n', '1', '--format=%ai'])
286
272
 
287
- @staticmethod
288
- def cleanup(options, args, file_list):
289
- """'Cleanup' the repo.
290
-
291
- There's no real git equivalent for the svn cleanup command, do a no-op.
292
- """
293
-
294
273
  def diff(self, options, _args, _file_list):
295
274
  try:
296
275
  merge_base = [self._Capture(['merge-base', 'HEAD', self.remote])]
@@ -314,15 +293,36 @@ class GitWrapper(SCMWrapper):
314
293
  cwd=self.checkout_path,
315
294
  filter_fn=GitDiffFilterer(self.relpath, print_func=self.Print).Filter)
316
295
 
317
- def _FetchAndReset(self, revision, file_list, options):
318
- """Equivalent to git fetch; git reset."""
296
+ def _Scrub(self, target, options):
297
+ """Scrubs out all changes in the local repo, back to the state of target."""
319
298
  quiet = []
320
299
  if not options.verbose:
321
300
  quiet = ['--quiet']
301
+ self._Run(['reset', '--hard', target] + quiet, options)
302
+ if options.force and options.delete_unversioned_trees:
303
+ # where `target` is a commit that contains both upper and lower case
304
+ # versions of the same file on a case insensitive filesystem, we are
305
+ # actually in a broken state here. The index will have both 'a' and 'A',
306
+ # but only one of them will exist on the disk. To progress, we delete
307
+ # everything that status thinks is modified.
308
+ output = self._Capture(['status', '--porcelain'], strip=False)
309
+ for line in output.splitlines():
310
+ # --porcelain (v1) looks like:
311
+ # XY filename
312
+ try:
313
+ filename = line[3:]
314
+ self.Print('_____ Deleting residual after reset: %r.' % filename)
315
+ gclient_utils.rm_file_or_tree(
316
+ os.path.join(self.checkout_path, filename))
317
+ except OSError:
318
+ pass
319
+
320
+ def _FetchAndReset(self, revision, file_list, options):
321
+ """Equivalent to git fetch; git reset."""
322
322
  self._UpdateBranchHeads(options, fetch=False)
323
323
 
324
324
  self._Fetch(options, prune=True, quiet=options.verbose)
325
- self._Run(['reset', '--hard', revision] + quiet, options)
325
+ self._Scrub(revision, options)
326
326
  if file_list is not None:
327
327
  files = self._Capture(['ls-files']).splitlines()
328
328
  file_list.extend([os.path.join(self.checkout_path, f) for f in files])
@@ -375,7 +375,6 @@ class GitWrapper(SCMWrapper):
375
375
  # If a dependency is not pinned, track the default remote branch.
376
376
  default_rev = 'refs/remotes/%s/master' % self.remote
377
377
  url, deps_revision = gclient_utils.SplitUrlRevision(self.url)
378
- rev_str = ""
379
378
  revision = deps_revision
380
379
  managed = True
381
380
  if options.revision:
@@ -392,21 +391,10 @@ class GitWrapper(SCMWrapper):
392
391
  if managed:
393
392
  self._DisableHooks()
394
393
 
395
- if gclient_utils.IsDateRevision(revision):
396
- # Date-revisions only work on git-repositories if the reflog hasn't
397
- # expired yet. Use rev-list to get the corresponding revision.
398
- # git rev-list -n 1 --before='time-stamp' branchname
399
- if options.transitive:
400
- self.Print('Warning: --transitive only works for SVN repositories.')
401
- revision = default_rev
402
-
403
- rev_str = ' at %s' % revision
404
- files = [] if file_list is not None else None
405
-
406
394
  printed_path = False
407
395
  verbose = []
408
396
  if options.verbose:
409
- self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
397
+ self.Print('_____ %s at %s' % (self.relpath, revision), timestamp=False)
410
398
  verbose = ['--verbose']
411
399
  printed_path = True
412
400
 
@@ -439,7 +427,7 @@ class GitWrapper(SCMWrapper):
439
427
  gclient_utils.safe_makedirs(self.checkout_path)
440
428
  os.rename(backup_dir, target_dir)
441
429
  # Reset to a clean state
442
- self._Run(['reset', '--hard', 'HEAD'], options)
430
+ self._Scrub('HEAD', options)
443
431
 
444
432
  if (not os.path.exists(self.checkout_path) or
445
433
  (os.path.isdir(self.checkout_path) and
@@ -487,7 +475,7 @@ class GitWrapper(SCMWrapper):
487
475
  self.Print('_____ switching %s to a new upstream' % self.relpath)
488
476
  if not (options.force or options.reset):
489
477
  # Make sure it's clean
490
- self._CheckClean(rev_str)
478
+ self._CheckClean(revision)
491
479
  # Switch over to the new upstream
492
480
  self._Run(['remote', 'set-url', self.remote, url], options)
493
481
  if mirror:
@@ -511,7 +499,7 @@ class GitWrapper(SCMWrapper):
511
499
  # 0) HEAD is detached. Probably from our initial clone.
512
500
  # - make sure HEAD is contained by a named ref, then update.
513
501
  # Cases 1-4. HEAD is a branch.
514
- # 1) current branch is not tracking a remote branch (could be git-svn)
502
+ # 1) current branch is not tracking a remote branch
515
503
  # - try to rebase onto the new hash or branch
516
504
  # 2) current branch is tracking a remote branch with local committed
517
505
  # changes, but the DEPS file switched to point to a hash
@@ -560,12 +548,18 @@ class GitWrapper(SCMWrapper):
560
548
  target = 'HEAD'
561
549
  if options.upstream and upstream_branch:
562
550
  target = upstream_branch
563
- self._Run(['reset', '--hard', target], options)
551
+ self._Scrub(target, options)
564
552
 
565
553
  if current_type == 'detached':
566
554
  # case 0
567
- self._CheckClean(rev_str)
568
- self._CheckDetachedHead(rev_str, options)
555
+ # We just did a Scrub, this is as clean as it's going to get. In
556
+ # particular if HEAD is a commit that contains two versions of the same
557
+ # file on a case-insensitive filesystem (e.g. 'a' and 'A'), there's no way
558
+ # to actually "Clean" the checkout; that commit is uncheckoutable on this
559
+ # system. The best we can do is carry forward to the checkout step.
560
+ if not (options.force or options.reset):
561
+ self._CheckClean(revision)
562
+ self._CheckDetachedHead(revision, options)
569
563
  if self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision:
570
564
  self.Print('Up-to-date; skipping checkout.')
571
565
  else:
@@ -578,28 +572,21 @@ class GitWrapper(SCMWrapper):
578
572
  quiet=True,
579
573
  )
580
574
  if not printed_path:
581
- self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
575
+ self.Print('_____ %s at %s' % (self.relpath, revision), timestamp=False)
582
576
  elif current_type == 'hash':
583
577
  # case 1
584
- if scm.GIT.IsGitSvn(self.checkout_path) and upstream_branch is not None:
585
- # Our git-svn branch (upstream_branch) is our upstream
586
- self._AttemptRebase(upstream_branch, files, options,
587
- newbase=revision, printed_path=printed_path,
588
- merge=options.merge)
589
- printed_path = True
590
- else:
591
- # Can't find a merge-base since we don't know our upstream. That makes
592
- # this command VERY likely to produce a rebase failure. For now we
593
- # assume origin is our upstream since that's what the old behavior was.
594
- upstream_branch = self.remote
595
- if options.revision or deps_revision:
596
- upstream_branch = revision
597
- self._AttemptRebase(upstream_branch, files, options,
598
- printed_path=printed_path, merge=options.merge)
599
- printed_path = True
578
+ # Can't find a merge-base since we don't know our upstream. That makes
579
+ # this command VERY likely to produce a rebase failure. For now we
580
+ # assume origin is our upstream since that's what the old behavior was.
581
+ upstream_branch = self.remote
582
+ if options.revision or deps_revision:
583
+ upstream_branch = revision
584
+ self._AttemptRebase(upstream_branch, file_list, options,
585
+ printed_path=printed_path, merge=options.merge)
586
+ printed_path = True
600
587
  elif rev_type == 'hash':
601
588
  # case 2
602
- self._AttemptRebase(upstream_branch, files, options,
589
+ self._AttemptRebase(upstream_branch, file_list, options,
603
590
  newbase=revision, printed_path=printed_path,
604
591
  merge=options.merge)
605
592
  printed_path = True
@@ -607,7 +594,7 @@ class GitWrapper(SCMWrapper):
607
594
  # case 4
608
595
  new_base = ''.join(remote_ref)
609
596
  if not printed_path:
610
- self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
597
+ self.Print('_____ %s at %s' % (self.relpath, revision), timestamp=False)
611
598
  switch_error = ("Could not switch upstream branch from %s to %s\n"
612
599
  % (upstream_branch, new_base) +
613
600
  "Please use --force or merge or rebase manually:\n" +
@@ -616,7 +603,7 @@ class GitWrapper(SCMWrapper):
616
603
  force_switch = False
617
604
  if options.force:
618
605
  try:
619
- self._CheckClean(rev_str)
606
+ self._CheckClean(revision)
620
607
  # case 4a
621
608
  force_switch = True
622
609
  except gclient_utils.Error as e:
@@ -636,8 +623,8 @@ class GitWrapper(SCMWrapper):
636
623
  raise gclient_utils.Error(switch_error)
637
624
  else:
638
625
  # case 3 - the default case
639
- if files is not None:
640
- files = self._Capture(['diff', upstream_branch, '--name-only']).split()
626
+ rebase_files = self._Capture(
627
+ ['diff', upstream_branch, '--name-only']).split()
641
628
  if verbose:
642
629
  self.Print('Trying fast-forward merge to branch : %s' % upstream_branch)
643
630
  try:
@@ -649,10 +636,11 @@ class GitWrapper(SCMWrapper):
649
636
  merge_args.append(upstream_branch)
650
637
  merge_output = self._Capture(merge_args)
651
638
  except subprocess2.CalledProcessError as e:
639
+ rebase_files = []
652
640
  if re.match('fatal: Not possible to fast-forward, aborting.', e.stderr):
653
- files = []
654
641
  if not printed_path:
655
- self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
642
+ self.Print('_____ %s at %s' % (self.relpath, revision),
643
+ timestamp=False)
656
644
  printed_path = True
657
645
  while True:
658
646
  if not options.auto_rebase:
@@ -665,7 +653,7 @@ class GitWrapper(SCMWrapper):
665
653
  except ValueError:
666
654
  raise gclient_utils.Error('Invalid Character')
667
655
  if options.auto_rebase or re.match(r'yes|y', action, re.I):
668
- self._AttemptRebase(upstream_branch, files, options,
656
+ self._AttemptRebase(upstream_branch, rebase_files, options,
669
657
  printed_path=printed_path, merge=False)
670
658
  printed_path = True
671
659
  break
@@ -684,7 +672,8 @@ class GitWrapper(SCMWrapper):
684
672
  "changes or stash them before you can merge.\n",
685
673
  e.stderr):
686
674
  if not printed_path:
687
- self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
675
+ self.Print('_____ %s at %s' % (self.relpath, revision),
676
+ timestamp=False)
688
677
  printed_path = True
689
678
  raise gclient_utils.Error(e.stderr)
690
679
  else:
@@ -696,7 +685,8 @@ class GitWrapper(SCMWrapper):
696
685
  # Fast-forward merge was successful
697
686
  if not re.match('Already up-to-date.', merge_output) or verbose:
698
687
  if not printed_path:
699
- self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
688
+ self.Print('_____ %s at %s' % (self.relpath, revision),
689
+ timestamp=False)
700
690
  printed_path = True
701
691
  self.Print(merge_output.strip())
702
692
  if not verbose:
@@ -704,16 +694,17 @@ class GitWrapper(SCMWrapper):
704
694
  # whitespace between projects when syncing.
705
695
  self.Print('')
706
696
 
707
- if file_list is not None:
708
- file_list.extend([os.path.join(self.checkout_path, f) for f in files])
697
+ if file_list is not None:
698
+ file_list.extend(
699
+ [os.path.join(self.checkout_path, f) for f in rebase_files])
709
700
 
710
701
  # If the rebase generated a conflict, abort and ask user to fix
711
702
  if self._IsRebasing():
712
- raise gclient_utils.Error('\n____ %s%s\n'
703
+ raise gclient_utils.Error('\n____ %s at %s\n'
713
704
  '\nConflict while rebasing this branch.\n'
714
705
  'Fix the conflict and run gclient again.\n'
715
706
  'See man git-rebase for details.\n'
716
- % (self.relpath, rev_str))
707
+ % (self.relpath, revision))
717
708
 
718
709
  if verbose:
719
710
  self.Print('Checked out revision %s' % self.revinfo(options, (), None),
@@ -772,7 +763,7 @@ class GitWrapper(SCMWrapper):
772
763
  if file_list is not None:
773
764
  files = self._Capture(['diff', deps_revision, '--name-only']).split()
774
765
 
775
- self._Run(['reset', '--hard', deps_revision], options)
766
+ self._Scrub(deps_revision, options)
776
767
  self._Run(['clean', '-f', '-d'], options)
777
768
 
778
769
  if file_list is not None:
@@ -796,75 +787,30 @@ class GitWrapper(SCMWrapper):
796
787
  except subprocess2.CalledProcessError:
797
788
  merge_base = []
798
789
  self._Run(['diff', '--name-status'] + merge_base, options,
799
- stdout=self.out_fh)
790
+ stdout=self.out_fh, always=options.verbose)
800
791
  if file_list is not None:
801
792
  files = self._Capture(['diff', '--name-only'] + merge_base).split()
802
793
  file_list.extend([os.path.join(self.checkout_path, f) for f in files])
803
794
 
804
795
  def GetUsableRev(self, rev, options):
805
- """Finds a useful revision for this repository.
806
-
807
- If SCM is git-svn and the head revision is less than |rev|, git svn fetch
808
- will be called on the source."""
796
+ """Finds a useful revision for this repository."""
809
797
  sha1 = None
810
798
  if not os.path.isdir(self.checkout_path):
811
799
  raise NoUsableRevError(
812
- ( 'We could not find a valid hash for safesync_url response "%s".\n'
813
- 'Safesync URLs with a git checkout currently require the repo to\n'
814
- 'be cloned without a safesync_url before adding the safesync_url.\n'
815
- 'For more info, see: '
816
- 'http://code.google.com/p/chromium/wiki/UsingNewGit'
817
- '#Initial_checkout' ) % rev)
818
- elif rev.isdigit() and len(rev) < 7:
819
- # Handles an SVN rev. As an optimization, only verify an SVN revision as
820
- # [0-9]{1,6} for now to avoid making a network request.
821
- if scm.GIT.IsGitSvn(cwd=self.checkout_path):
822
- local_head = scm.GIT.GetGitSvnHeadRev(cwd=self.checkout_path)
823
- if not local_head or local_head < int(rev):
824
- try:
825
- logging.debug('Looking for git-svn configuration optimizations.')
826
- if scm.GIT.Capture(['config', '--get', 'svn-remote.svn.fetch'],
827
- cwd=self.checkout_path):
828
- self._Fetch(options)
829
- except subprocess2.CalledProcessError:
830
- logging.debug('git config --get svn-remote.svn.fetch failed, '
831
- 'ignoring possible optimization.')
832
- if options.verbose:
833
- self.Print('Running git svn fetch. This might take a while.\n')
834
- scm.GIT.Capture(['svn', 'fetch'], cwd=self.checkout_path)
835
- try:
836
- sha1 = scm.GIT.GetBlessedSha1ForSvnRev(
837
- cwd=self.checkout_path, rev=rev)
838
- except gclient_utils.Error, e:
839
- sha1 = e.message
840
- self.Print('Warning: Could not find a git revision with accurate\n'
841
- '.DEPS.git that maps to SVN revision %s. Sync-ing to\n'
842
- 'the closest sane git revision, which is:\n'
843
- ' %s\n' % (rev, e.message))
844
- if not sha1:
845
- raise NoUsableRevError(
846
- ( 'It appears that either your git-svn remote is incorrectly\n'
847
- 'configured or the revision in your safesync_url is\n'
848
- 'higher than git-svn remote\'s HEAD as we couldn\'t find a\n'
849
- 'corresponding git hash for SVN rev %s.' ) % rev)
800
+ 'This is not a git repo, so we cannot get a usable rev.')
801
+
802
+ if scm.GIT.IsValidRevision(cwd=self.checkout_path, rev=rev):
803
+ sha1 = rev
850
804
  else:
805
+ # May exist in origin, but we don't have it yet, so fetch and look
806
+ # again.
807
+ self._Fetch(options)
851
808
  if scm.GIT.IsValidRevision(cwd=self.checkout_path, rev=rev):
852
809
  sha1 = rev
853
- else:
854
- # May exist in origin, but we don't have it yet, so fetch and look
855
- # again.
856
- self._Fetch(options)
857
- if scm.GIT.IsValidRevision(cwd=self.checkout_path, rev=rev):
858
- sha1 = rev
859
810
 
860
811
  if not sha1:
861
812
  raise NoUsableRevError(
862
- ( 'We could not find a valid hash for safesync_url response "%s".\n'
863
- 'Safesync URLs with a git checkout currently require a git-svn\n'
864
- 'remote or a safesync_url that provides git sha1s. Please add a\n'
865
- 'git-svn remote or change your safesync_url. For more info, see:\n'
866
- 'http://code.google.com/p/chromium/wiki/UsingNewGit'
867
- '#Initial_checkout' ) % rev)
813
+ 'Hash %s does not appear to be a valid hash in this repo.' % rev)
868
814
 
869
815
  return sha1
870
816
 
@@ -1042,7 +988,7 @@ class GitWrapper(SCMWrapper):
1042
988
  'WARNING: destroys any uncommitted work in your current branch!'
1043
989
  ' (y)es / (q)uit / (s)how : ', options)
1044
990
  if re.match(r'yes|y', rebase_action, re.I):
1045
- self._Run(['reset', '--hard', 'HEAD'], options)
991
+ self._Scrub('HEAD', options)
1046
992
  # Should this be recursive?
1047
993
  rebase_output = scm.GIT.Capture(rebase_cmd, cwd=self.checkout_path)
1048
994
  break
@@ -1113,35 +1059,35 @@ class GitWrapper(SCMWrapper):
1113
1059
  os.path.isdir(os.path.join(g, "rebase-merge")) or
1114
1060
  os.path.isdir(os.path.join(g, "rebase-apply")))
1115
1061
 
1116
- def _CheckClean(self, rev_str):
1062
+ def _CheckClean(self, revision, fixup=False):
1117
1063
  lockfile = os.path.join(self.checkout_path, ".git", "index.lock")
1118
1064
  if os.path.exists(lockfile):
1119
1065
  raise gclient_utils.Error(
1120
- '\n____ %s%s\n'
1066
+ '\n____ %s at %s\n'
1121
1067
  '\tYour repo is locked, possibly due to a concurrent git process.\n'
1122
1068
  '\tIf no git executable is running, then clean up %r and try again.\n'
1123
- % (self.relpath, rev_str, lockfile))
1069
+ % (self.relpath, revision, lockfile))
1124
1070
 
1125
1071
  # Make sure the tree is clean; see git-rebase.sh for reference
1126
1072
  try:
1127
1073
  scm.GIT.Capture(['update-index', '--ignore-submodules', '--refresh'],
1128
1074
  cwd=self.checkout_path)
1129
1075
  except subprocess2.CalledProcessError:
1130
- raise gclient_utils.Error('\n____ %s%s\n'
1076
+ raise gclient_utils.Error('\n____ %s at %s\n'
1131
1077
  '\tYou have unstaged changes.\n'
1132
1078
  '\tPlease commit, stash, or reset.\n'
1133
- % (self.relpath, rev_str))
1079
+ % (self.relpath, revision))
1134
1080
  try:
1135
1081
  scm.GIT.Capture(['diff-index', '--cached', '--name-status', '-r',
1136
1082
  '--ignore-submodules', 'HEAD', '--'],
1137
1083
  cwd=self.checkout_path)
1138
1084
  except subprocess2.CalledProcessError:
1139
- raise gclient_utils.Error('\n____ %s%s\n'
1085
+ raise gclient_utils.Error('\n____ %s at %s\n'
1140
1086
  '\tYour index contains uncommitted changes\n'
1141
1087
  '\tPlease commit, stash, or reset.\n'
1142
- % (self.relpath, rev_str))
1088
+ % (self.relpath, revision))
1143
1089
 
1144
- def _CheckDetachedHead(self, rev_str, _options):
1090
+ def _CheckDetachedHead(self, revision, _options):
1145
1091
  # HEAD is detached. Make sure it is safe to move away from (i.e., it is
1146
1092
  # reference by a commit). If not, error out -- most likely a rebase is
1147
1093
  # in progress, try to detect so we can give a better error.
@@ -1152,12 +1098,12 @@ class GitWrapper(SCMWrapper):
1152
1098
  # Commit is not contained by any rev. See if the user is rebasing:
1153
1099
  if self._IsRebasing():
1154
1100
  # Punt to the user
1155
- raise gclient_utils.Error('\n____ %s%s\n'
1101
+ raise gclient_utils.Error('\n____ %s at %s\n'
1156
1102
  '\tAlready in a conflict, i.e. (no branch).\n'
1157
1103
  '\tFix the conflict and run gclient again.\n'
1158
1104
  '\tOr to abort run:\n\t\tgit-rebase --abort\n'
1159
1105
  '\tSee man git-rebase for details.\n'
1160
- % (self.relpath, rev_str))
1106
+ % (self.relpath, revision))
1161
1107
  # Let's just save off the commit so we can proceed.
1162
1108
  name = ('saved-by-gclient-' +
1163
1109
  self._Capture(['rev-parse', '--short', 'HEAD']))
@@ -1175,8 +1121,12 @@ class GitWrapper(SCMWrapper):
1175
1121
  def _Capture(self, args, **kwargs):
1176
1122
  kwargs.setdefault('cwd', self.checkout_path)
1177
1123
  kwargs.setdefault('stderr', subprocess2.PIPE)
1124
+ strip = kwargs.pop('strip', True)
1178
1125
  env = scm.GIT.ApplyEnvVars(kwargs)
1179
- return subprocess2.check_output(['git'] + args, env=env, **kwargs).strip()
1126
+ ret = subprocess2.check_output(['git'] + args, env=env, **kwargs)
1127
+ if strip:
1128
+ ret = ret.strip()
1129
+ return ret
1180
1130
 
1181
1131
  def _Checkout(self, options, ref, force=False, quiet=None):
1182
1132
  """Performs a 'git-checkout' operation.
@@ -1199,7 +1149,6 @@ class GitWrapper(SCMWrapper):
1199
1149
  return self._Capture(checkout_args)
1200
1150
 
1201
1151
  def _Fetch(self, options, remote=None, prune=False, quiet=False):
1202
- kill_timeout = float(os.getenv('GCLIENT_KILL_GIT_FETCH_AFTER', 0))
1203
1152
  cfg = gclient_utils.DefaultIndexPackConfig(self.url)
1204
1153
  fetch_cmd = cfg + [
1205
1154
  'fetch',
@@ -1212,8 +1161,7 @@ class GitWrapper(SCMWrapper):
1212
1161
  fetch_cmd.append('--verbose')
1213
1162
  elif quiet:
1214
1163
  fetch_cmd.append('--quiet')
1215
- self._Run(fetch_cmd, options, show_header=options.verbose, retry=True,
1216
- kill_timeout=kill_timeout)
1164
+ self._Run(fetch_cmd, options, show_header=options.verbose, retry=True)
1217
1165
 
1218
1166
  # Return the revision that was fetched; this will be stored in 'FETCH_HEAD'
1219
1167
  return self._Capture(['rev-parse', '--verify', 'FETCH_HEAD'])
@@ -1235,10 +1183,10 @@ class GitWrapper(SCMWrapper):
1235
1183
  self._Run(config_cmd, options)
1236
1184
  need_fetch = True
1237
1185
  if fetch and need_fetch:
1238
- self._Fetch(options)
1186
+ self._Fetch(options, prune=options.force)
1239
1187
 
1240
1188
  def _Run(self, args, options, show_header=True, **kwargs):
1241
- # Disable 'unused options' warning | pylint: disable=W0613
1189
+ # Disable 'unused options' warning | pylint: disable=unused-argument
1242
1190
  kwargs.setdefault('cwd', self.checkout_path)
1243
1191
  kwargs.setdefault('stdout', self.out_fh)
1244
1192
  kwargs['filter_fn'] = self.filter
@@ -1249,490 +1197,3 @@ class GitWrapper(SCMWrapper):
1249
1197
  gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs)
1250
1198
  else:
1251
1199
  gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
1252
-
1253
-
1254
- class SVNWrapper(SCMWrapper):
1255
- """ Wrapper for SVN """
1256
- name = 'svn'
1257
- _PRINTED_DEPRECATION = False
1258
-
1259
- _MESSAGE = (
1260
- 'Oh hai! You are using subversion. Chrome infra is eager to get rid of',
1261
- 'svn support so please switch to git.',
1262
- 'Tracking bug: http://crbug.com/475320',
1263
- 'If you are a project owner, you may request git migration assistance at: ',
1264
- ' https://code.google.com/p/chromium/issues/entry?template=Infra-Git')
1265
-
1266
- def __init__(self, *args, **kwargs):
1267
- super(SVNWrapper, self).__init__(*args, **kwargs)
1268
- suppress_deprecated_notice = os.environ.get(
1269
- 'SUPPRESS_DEPRECATED_SVN_NOTICE', False)
1270
- if not SVNWrapper._PRINTED_DEPRECATION and not suppress_deprecated_notice:
1271
- SVNWrapper._PRINTED_DEPRECATION = True
1272
- sys.stderr.write('\n'.join(self._MESSAGE) + '\n')
1273
-
1274
- @staticmethod
1275
- def BinaryExists():
1276
- """Returns true if the command exists."""
1277
- try:
1278
- result, version = scm.SVN.AssertVersion('1.4')
1279
- if not result:
1280
- raise gclient_utils.Error('SVN version is older than 1.4: %s' % version)
1281
- return result
1282
- except OSError:
1283
- return False
1284
-
1285
- def GetCheckoutRoot(self):
1286
- return scm.SVN.GetCheckoutRoot(self.checkout_path)
1287
-
1288
- def GetRevisionDate(self, revision):
1289
- """Returns the given revision's date in ISO-8601 format (which contains the
1290
- time zone)."""
1291
- date = scm.SVN.Capture(
1292
- ['propget', '--revprop', 'svn:date', '-r', revision],
1293
- os.path.join(self.checkout_path, '.'))
1294
- return date.strip()
1295
-
1296
- def cleanup(self, options, args, _file_list):
1297
- """Cleanup working copy."""
1298
- self._Run(['cleanup'] + args, options)
1299
-
1300
- def diff(self, options, args, _file_list):
1301
- # NOTE: This function does not currently modify file_list.
1302
- if not os.path.isdir(self.checkout_path):
1303
- raise gclient_utils.Error('Directory %s is not present.' %
1304
- self.checkout_path)
1305
- self._Run(['diff'] + args, options)
1306
-
1307
- def pack(self, _options, args, _file_list):
1308
- """Generates a patch file which can be applied to the root of the
1309
- repository."""
1310
- if not os.path.isdir(self.checkout_path):
1311
- raise gclient_utils.Error('Directory %s is not present.' %
1312
- self.checkout_path)
1313
- gclient_utils.CheckCallAndFilter(
1314
- ['svn', 'diff', '-x', '--ignore-eol-style'] + args,
1315
- cwd=self.checkout_path,
1316
- print_stdout=False,
1317
- filter_fn=SvnDiffFilterer(self.relpath, print_func=self.Print).Filter)
1318
-
1319
- def update(self, options, args, file_list):
1320
- """Runs svn to update or transparently checkout the working copy.
1321
-
1322
- All updated files will be appended to file_list.
1323
-
1324
- Raises:
1325
- Error: if can't get URL for relative path.
1326
- """
1327
- # Only update if hg is not controlling the directory.
1328
- hg_path = os.path.join(self.checkout_path, '.hg')
1329
- if os.path.exists(hg_path):
1330
- self.Print('________ found .hg directory; skipping %s' % self.relpath)
1331
- return
1332
-
1333
- if args:
1334
- raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args))
1335
-
1336
- # revision is the revision to match. It is None if no revision is specified,
1337
- # i.e. the 'deps ain't pinned'.
1338
- url, revision = gclient_utils.SplitUrlRevision(self.url)
1339
- # Keep the original unpinned url for reference in case the repo is switched.
1340
- base_url = url
1341
- managed = True
1342
- if options.revision:
1343
- # Override the revision number.
1344
- revision = str(options.revision)
1345
- if revision:
1346
- if revision != 'unmanaged':
1347
- forced_revision = True
1348
- # Reconstruct the url.
1349
- url = '%s@%s' % (url, revision)
1350
- rev_str = ' at %s' % revision
1351
- else:
1352
- managed = False
1353
- revision = None
1354
- else:
1355
- forced_revision = False
1356
- rev_str = ''
1357
-
1358
- exists = os.path.exists(self.checkout_path)
1359
- if exists and managed:
1360
- # Git is only okay if it's a git-svn checkout of the right repo.
1361
- if scm.GIT.IsGitSvn(self.checkout_path):
1362
- remote_url = scm.GIT.Capture(['config', '--local', '--get',
1363
- 'svn-remote.svn.url'],
1364
- cwd=self.checkout_path).rstrip()
1365
- if remote_url.rstrip('/') == base_url.rstrip('/'):
1366
- self.Print('\n_____ %s looks like a git-svn checkout. Skipping.'
1367
- % self.relpath)
1368
- return # TODO(borenet): Get the svn revision number?
1369
-
1370
- # Get the existing scm url and the revision number of the current checkout.
1371
- if exists and managed:
1372
- try:
1373
- from_info = scm.SVN.CaptureLocalInfo(
1374
- [], os.path.join(self.checkout_path, '.'))
1375
- except (gclient_utils.Error, subprocess2.CalledProcessError):
1376
- self._DeleteOrMove(options.force)
1377
- exists = False
1378
-
1379
- BASE_URLS = {
1380
- '/chrome/trunk/src': 'gs://chromium-svn-checkout/chrome/',
1381
- '/blink/trunk': 'gs://chromium-svn-checkout/blink/',
1382
- }
1383
- WHITELISTED_ROOTS = [
1384
- 'svn://svn.chromium.org',
1385
- 'svn://svn-mirror.golo.chromium.org',
1386
- ]
1387
- if not exists:
1388
- try:
1389
- # Split out the revision number since it's not useful for us.
1390
- base_path = urlparse.urlparse(url).path.split('@')[0]
1391
- # Check to see if we're on a whitelisted root. We do this because
1392
- # only some svn servers have matching UUIDs.
1393
- local_parsed = urlparse.urlparse(url)
1394
- local_root = '%s://%s' % (local_parsed.scheme, local_parsed.netloc)
1395
- if ('CHROME_HEADLESS' in os.environ
1396
- and sys.platform == 'linux2' # TODO(hinoka): Enable for win/mac.
1397
- and base_path in BASE_URLS
1398
- and local_root in WHITELISTED_ROOTS):
1399
-
1400
- # Use a tarball for initial sync if we are on a bot.
1401
- # Get an unauthenticated gsutil instance.
1402
- gsutil = download_from_google_storage.Gsutil(
1403
- GSUTIL_DEFAULT_PATH, boto_path=os.devnull)
1404
-
1405
- gs_path = BASE_URLS[base_path]
1406
- _, out, _ = gsutil.check_call('ls', gs_path)
1407
- # So that we can get the most recent revision.
1408
- sorted_items = sorted(out.splitlines())
1409
- latest_checkout = sorted_items[-1]
1410
-
1411
- tempdir = tempfile.mkdtemp()
1412
- self.Print('Downloading %s...' % latest_checkout)
1413
- code, out, err = gsutil.check_call('cp', latest_checkout, tempdir)
1414
- if code:
1415
- self.Print('%s\n%s' % (out, err))
1416
- raise Exception()
1417
- filename = latest_checkout.split('/')[-1]
1418
- tarball = os.path.join(tempdir, filename)
1419
- self.Print('Unpacking into %s...' % self.checkout_path)
1420
- gclient_utils.safe_makedirs(self.checkout_path)
1421
- # TODO(hinoka): Use 7z for windows.
1422
- cmd = ['tar', '--extract', '--ungzip',
1423
- '--directory', self.checkout_path,
1424
- '--file', tarball]
1425
- gclient_utils.CheckCallAndFilter(
1426
- cmd, stdout=sys.stdout, print_stdout=True)
1427
-
1428
- self.Print('Deleting temp file')
1429
- gclient_utils.rmtree(tempdir)
1430
-
1431
- # Rewrite the repository root to match.
1432
- tarball_url = scm.SVN.CaptureLocalInfo(
1433
- ['.'], self.checkout_path)['Repository Root']
1434
- tarball_parsed = urlparse.urlparse(tarball_url)
1435
- tarball_root = '%s://%s' % (tarball_parsed.scheme,
1436
- tarball_parsed.netloc)
1437
-
1438
- if tarball_root != local_root:
1439
- self.Print('Switching repository root to %s' % local_root)
1440
- self._Run(['switch', '--relocate', tarball_root,
1441
- local_root, self.checkout_path],
1442
- options)
1443
- except Exception as e:
1444
- self.Print('We tried to get a source tarball but failed.')
1445
- self.Print('Resuming normal operations.')
1446
- self.Print(str(e))
1447
-
1448
- gclient_utils.safe_makedirs(os.path.dirname(self.checkout_path))
1449
- # We need to checkout.
1450
- command = ['checkout', url, self.checkout_path]
1451
- command = self._AddAdditionalUpdateFlags(command, options, revision)
1452
- self._RunAndGetFileList(command, options, file_list, self._root_dir)
1453
- return self.Svnversion()
1454
-
1455
- if not managed:
1456
- self.Print(('________ unmanaged solution; skipping %s' % self.relpath))
1457
- if os.path.exists(os.path.join(self.checkout_path, '.svn')):
1458
- return self.Svnversion()
1459
- return
1460
-
1461
- if 'URL' not in from_info:
1462
- raise gclient_utils.Error(
1463
- ('gclient is confused. Couldn\'t get the url for %s.\n'
1464
- 'Try using @unmanaged.\n%s') % (
1465
- self.checkout_path, from_info))
1466
-
1467
- # Look for locked directories.
1468
- dir_info = scm.SVN.CaptureStatus(
1469
- None, os.path.join(self.checkout_path, '.'))
1470
- if any(d[0][2] == 'L' for d in dir_info):
1471
- try:
1472
- self._Run(['cleanup', self.checkout_path], options)
1473
- except subprocess2.CalledProcessError, e:
1474
- # Get the status again, svn cleanup may have cleaned up at least
1475
- # something.
1476
- dir_info = scm.SVN.CaptureStatus(
1477
- None, os.path.join(self.checkout_path, '.'))
1478
-
1479
- # Try to fix the failures by removing troublesome files.
1480
- for d in dir_info:
1481
- if d[0][2] == 'L':
1482
- if d[0][0] == '!' and options.force:
1483
- # We don't pass any files/directories to CaptureStatus and set
1484
- # cwd=self.checkout_path, so we should get relative paths here.
1485
- assert not os.path.isabs(d[1])
1486
- path_to_remove = os.path.normpath(
1487
- os.path.join(self.checkout_path, d[1]))
1488
- self.Print('Removing troublesome path %s' % path_to_remove)
1489
- gclient_utils.rmtree(path_to_remove)
1490
- else:
1491
- self.Print(
1492
- 'Not removing troublesome path %s automatically.' % d[1])
1493
- if d[0][0] == '!':
1494
- self.Print('You can pass --force to enable automatic removal.')
1495
- raise e
1496
-
1497
- # Retrieve the current HEAD version because svn is slow at null updates.
1498
- if options.manually_grab_svn_rev and not revision:
1499
- from_info_live = scm.SVN.CaptureRemoteInfo(from_info['URL'])
1500
- revision = str(from_info_live['Revision'])
1501
- rev_str = ' at %s' % revision
1502
-
1503
- if from_info['URL'].rstrip('/') != base_url.rstrip('/'):
1504
- # The repository url changed, need to switch.
1505
- try:
1506
- to_info = scm.SVN.CaptureRemoteInfo(url)
1507
- except (gclient_utils.Error, subprocess2.CalledProcessError):
1508
- # The url is invalid or the server is not accessible, it's safer to bail
1509
- # out right now.
1510
- raise gclient_utils.Error('This url is unreachable: %s' % url)
1511
- can_switch = ((from_info['Repository Root'] != to_info['Repository Root'])
1512
- and (from_info['UUID'] == to_info['UUID']))
1513
- if can_switch:
1514
- self.Print('_____ relocating %s to a new checkout' % self.relpath)
1515
- # We have different roots, so check if we can switch --relocate.
1516
- # Subversion only permits this if the repository UUIDs match.
1517
- # Perform the switch --relocate, then rewrite the from_url
1518
- # to reflect where we "are now." (This is the same way that
1519
- # Subversion itself handles the metadata when switch --relocate
1520
- # is used.) This makes the checks below for whether we
1521
- # can update to a revision or have to switch to a different
1522
- # branch work as expected.
1523
- # TODO(maruel): TEST ME !
1524
- command = ['switch', '--relocate',
1525
- from_info['Repository Root'],
1526
- to_info['Repository Root'],
1527
- self.relpath]
1528
- self._Run(command, options, cwd=self._root_dir)
1529
- from_info['URL'] = from_info['URL'].replace(
1530
- from_info['Repository Root'],
1531
- to_info['Repository Root'])
1532
- else:
1533
- if not options.force and not options.reset:
1534
- # Look for local modifications but ignore unversioned files.
1535
- for status in scm.SVN.CaptureStatus(None, self.checkout_path):
1536
- if status[0][0] != '?':
1537
- raise gclient_utils.Error(
1538
- ('Can\'t switch the checkout to %s; UUID don\'t match and '
1539
- 'there is local changes in %s. Delete the directory and '
1540
- 'try again.') % (url, self.checkout_path))
1541
- # Ok delete it.
1542
- self.Print('_____ switching %s to a new checkout' % self.relpath)
1543
- gclient_utils.rmtree(self.checkout_path)
1544
- # We need to checkout.
1545
- command = ['checkout', url, self.checkout_path]
1546
- command = self._AddAdditionalUpdateFlags(command, options, revision)
1547
- self._RunAndGetFileList(command, options, file_list, self._root_dir)
1548
- return self.Svnversion()
1549
-
1550
- # If the provided url has a revision number that matches the revision
1551
- # number of the existing directory, then we don't need to bother updating.
1552
- if not options.force and str(from_info['Revision']) == revision:
1553
- if options.verbose or not forced_revision:
1554
- self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
1555
- else:
1556
- command = ['update', self.checkout_path]
1557
- command = self._AddAdditionalUpdateFlags(command, options, revision)
1558
- self._RunAndGetFileList(command, options, file_list, self._root_dir)
1559
-
1560
- # If --reset and --delete_unversioned_trees are specified, remove any
1561
- # untracked files and directories.
1562
- if options.reset and options.delete_unversioned_trees:
1563
- for status in scm.SVN.CaptureStatus(None, self.checkout_path):
1564
- full_path = os.path.join(self.checkout_path, status[1])
1565
- if (status[0][0] == '?'
1566
- and os.path.isdir(full_path)
1567
- and not os.path.islink(full_path)):
1568
- self.Print('_____ removing unversioned directory %s' % status[1])
1569
- gclient_utils.rmtree(full_path)
1570
- return self.Svnversion()
1571
-
1572
- def updatesingle(self, options, args, file_list):
1573
- filename = args.pop()
1574
- if scm.SVN.AssertVersion("1.5")[0]:
1575
- if not os.path.exists(os.path.join(self.checkout_path, '.svn')):
1576
- # Create an empty checkout and then update the one file we want. Future
1577
- # operations will only apply to the one file we checked out.
1578
- command = ["checkout", "--depth", "empty", self.url, self.checkout_path]
1579
- self._Run(command, options, cwd=self._root_dir)
1580
- if os.path.exists(os.path.join(self.checkout_path, filename)):
1581
- os.remove(os.path.join(self.checkout_path, filename))
1582
- command = ["update", filename]
1583
- self._RunAndGetFileList(command, options, file_list)
1584
- # After the initial checkout, we can use update as if it were any other
1585
- # dep.
1586
- self.update(options, args, file_list)
1587
- else:
1588
- # If the installed version of SVN doesn't support --depth, fallback to
1589
- # just exporting the file. This has the downside that revision
1590
- # information is not stored next to the file, so we will have to
1591
- # re-export the file every time we sync.
1592
- if not os.path.exists(self.checkout_path):
1593
- gclient_utils.safe_makedirs(self.checkout_path)
1594
- command = ["export", os.path.join(self.url, filename),
1595
- os.path.join(self.checkout_path, filename)]
1596
- command = self._AddAdditionalUpdateFlags(command, options,
1597
- options.revision)
1598
- self._Run(command, options, cwd=self._root_dir)
1599
-
1600
- def revert(self, options, _args, file_list):
1601
- """Reverts local modifications. Subversion specific.
1602
-
1603
- All reverted files will be appended to file_list, even if Subversion
1604
- doesn't know about them.
1605
- """
1606
- if not os.path.isdir(self.checkout_path):
1607
- if os.path.exists(self.checkout_path):
1608
- gclient_utils.rmtree(self.checkout_path)
1609
- # svn revert won't work if the directory doesn't exist. It needs to
1610
- # checkout instead.
1611
- self.Print('_____ %s is missing, synching instead' % self.relpath)
1612
- # Don't reuse the args.
1613
- return self.update(options, [], file_list)
1614
-
1615
- if not os.path.isdir(os.path.join(self.checkout_path, '.svn')):
1616
- if os.path.isdir(os.path.join(self.checkout_path, '.git')):
1617
- self.Print('________ found .git directory; skipping %s' % self.relpath)
1618
- return
1619
- if os.path.isdir(os.path.join(self.checkout_path, '.hg')):
1620
- self.Print('________ found .hg directory; skipping %s' % self.relpath)
1621
- return
1622
- if not options.force:
1623
- raise gclient_utils.Error('Invalid checkout path, aborting')
1624
- self.Print(
1625
- '\n_____ %s is not a valid svn checkout, synching instead' %
1626
- self.relpath)
1627
- gclient_utils.rmtree(self.checkout_path)
1628
- # Don't reuse the args.
1629
- return self.update(options, [], file_list)
1630
-
1631
- def printcb(file_status):
1632
- if file_list is not None:
1633
- file_list.append(file_status[1])
1634
- if logging.getLogger().isEnabledFor(logging.INFO):
1635
- logging.info('%s%s' % (file_status[0], file_status[1]))
1636
- else:
1637
- self.Print(os.path.join(self.checkout_path, file_status[1]))
1638
- scm.SVN.Revert(self.checkout_path, callback=printcb)
1639
-
1640
- # Revert() may delete the directory altogether.
1641
- if not os.path.isdir(self.checkout_path):
1642
- # Don't reuse the args.
1643
- return self.update(options, [], file_list)
1644
-
1645
- try:
1646
- # svn revert is so broken we don't even use it. Using
1647
- # "svn up --revision BASE" achieve the same effect.
1648
- # file_list will contain duplicates.
1649
- self._RunAndGetFileList(['update', '--revision', 'BASE'], options,
1650
- file_list)
1651
- except OSError, e:
1652
- # Maybe the directory disappeared meanwhile. Do not throw an exception.
1653
- logging.error('Failed to update:\n%s' % str(e))
1654
-
1655
- def revinfo(self, _options, _args, _file_list):
1656
- """Display revision"""
1657
- try:
1658
- return scm.SVN.CaptureRevision(self.checkout_path)
1659
- except (gclient_utils.Error, subprocess2.CalledProcessError):
1660
- return None
1661
-
1662
- def runhooks(self, options, args, file_list):
1663
- self.status(options, args, file_list)
1664
-
1665
- def status(self, options, args, file_list):
1666
- """Display status information."""
1667
- command = ['status'] + args
1668
- if not os.path.isdir(self.checkout_path):
1669
- # svn status won't work if the directory doesn't exist.
1670
- self.Print(('\n________ couldn\'t run \'%s\' in \'%s\':\n'
1671
- 'The directory does not exist.') %
1672
- (' '.join(command), self.checkout_path))
1673
- # There's no file list to retrieve.
1674
- else:
1675
- self._RunAndGetFileList(command, options, file_list)
1676
-
1677
- def GetUsableRev(self, rev, _options):
1678
- """Verifies the validity of the revision for this repository."""
1679
- if not scm.SVN.IsValidRevision(url='%s@%s' % (self.url, rev)):
1680
- raise NoUsableRevError(
1681
- ( '%s isn\'t a valid revision. Please check that your safesync_url is\n'
1682
- 'correct.') % rev)
1683
- return rev
1684
-
1685
- def FullUrlForRelativeUrl(self, url):
1686
- # Find the forth '/' and strip from there. A bit hackish.
1687
- return '/'.join(self.url.split('/')[:4]) + url
1688
-
1689
- def _Run(self, args, options, **kwargs):
1690
- """Runs a commands that goes to stdout."""
1691
- kwargs.setdefault('cwd', self.checkout_path)
1692
- gclient_utils.CheckCallAndFilterAndHeader(['svn'] + args,
1693
- always=options.verbose, **kwargs)
1694
-
1695
- def Svnversion(self):
1696
- """Runs the lowest checked out revision in the current project."""
1697
- info = scm.SVN.CaptureLocalInfo([], os.path.join(self.checkout_path, '.'))
1698
- return info['Revision']
1699
-
1700
- def _RunAndGetFileList(self, args, options, file_list, cwd=None):
1701
- """Runs a commands that goes to stdout and grabs the file listed."""
1702
- cwd = cwd or self.checkout_path
1703
- scm.SVN.RunAndGetFileList(
1704
- options.verbose,
1705
- args + ['--ignore-externals'],
1706
- cwd=cwd,
1707
- file_list=file_list)
1708
-
1709
- @staticmethod
1710
- def _AddAdditionalUpdateFlags(command, options, revision):
1711
- """Add additional flags to command depending on what options are set.
1712
- command should be a list of strings that represents an svn command.
1713
-
1714
- This method returns a new list to be used as a command."""
1715
- new_command = command[:]
1716
- if revision:
1717
- new_command.extend(['--revision', str(revision).strip()])
1718
- # We don't want interaction when jobs are used.
1719
- if options.jobs > 1:
1720
- new_command.append('--non-interactive')
1721
- # --force was added to 'svn update' in svn 1.5.
1722
- # --accept was added to 'svn update' in svn 1.6.
1723
- if not scm.SVN.AssertVersion('1.5')[0]:
1724
- return new_command
1725
-
1726
- # It's annoying to have it block in the middle of a sync, just sensible
1727
- # defaults.
1728
- if options.force:
1729
- new_command.append('--force')
1730
- if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1731
- new_command.extend(('--accept', 'theirs-conflict'))
1732
- elif options.manually_grab_svn_rev:
1733
- new_command.append('--force')
1734
- if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1735
- new_command.extend(('--accept', 'postpone'))
1736
- elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1737
- new_command.extend(('--accept', 'postpone'))
1738
- return new_command