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
@@ -17,7 +17,7 @@ to the development flow, in the sense that you cannot successfully develop
17
17
  Chromium without them.
18
18
 
19
19
  Other tools are merely 'helper' tools. Not required, but they can substantially
20
- ease the develpment workflow.
20
+ ease the development workflow.
21
21
 
22
22
  A listing of both categories of tools follows.
23
23
 
@@ -96,8 +96,8 @@ extract it somewhere.
96
96
  extract the hidden ``.git'' folder which is necessary for 'depot_tools' to
97
97
  autoupdate itself. You can use ``Extract all...'' from the context menu though.
98
98
 
99
- Add 'depot_tools' to the 'end' of your PATH. Assuming you unzipped the
100
- bundle to `C:\workspace\depot_tools`:
99
+ Add 'depot_tools' to the 'start' of your PATH (must be ahead of any installs of
100
+ Python). Assuming you unzipped the bundle to `C:\workspace\depot_tools`:
101
101
 
102
102
  With Administrator access: ::
103
103
  *Control Panel -> System and Security -> System -> Advanced system settings*
@@ -107,7 +107,7 @@ Modify the PATH system variable to include `C:\workspace\depot_tools`.
107
107
  Without Administrator access: ::
108
108
  *Control Panel -> User Accounts -> User Accounts -> Change my environment variables*
109
109
  +
110
- Add a PATH user variable: `%PATH%;C:\workspace\depot_tools`.
110
+ Add a PATH user variable: `C:\workspace\depot_tools;%PATH%`.
111
111
 
112
112
  From a `cmd.exe` shell, run the command `gclient` (without arguments). On first
113
113
  run, gclient will install all the Windows-specific bits needed to work with the
@@ -121,10 +121,10 @@ code, including msysgit and python.
121
121
  * If you see strange errors with the file system on the first run of gclient,
122
122
  you may want to link:http://tortoisesvn.tigris.org/faq.html#cantmove2[disable
123
123
  Windows Indexing].
124
- * If you are running Windows XP and see errors like ``The system cannot execute
125
- the specified program'', try installing the
126
- link:http://code.google.com/p/chromium/issues/detail?id=75886[``Microsoft
127
- Visual C++ 2008 Redistributable Package''].
124
+ * After running gclient open a command prompt and type `where python` and confirm that
125
+ the depot_tools python.bat comes ahead of any copies of python.exe. Failing to ensure
126
+ this can lead to overbuilding when using gn - see
127
+ link:https://bugs.chromium.org/p/chromium/issues/detail?id=611087[crbug.com/611087].
128
128
  =====
129
129
  endif::backend-xhtml11[]
130
130
 
@@ -20,8 +20,8 @@ if not os.path.exists('ansi2html'):
20
20
  # if it doesn't exist, run ./make_docs.sh first
21
21
  sys.path.insert(0, 'ansi2html')
22
22
 
23
- import ansi2html # pylint: disable=F0401, W0611
24
- import ansi2html.converter # pylint: disable=F0401, W0611
23
+ import ansi2html # pylint: disable=import-error, W0611
24
+ import ansi2html.converter # pylint: disable=import-error, W0611
25
25
 
26
26
  def simpleXML(string):
27
27
  BRIGHT = 1
@@ -4,7 +4,7 @@
4
4
  add deleted_file
5
5
  add unstaged_deleted_file
6
6
  add modified_file
7
- c 'I commited this and am proud of it.
7
+ c 'I committed this and am proud of it.
8
8
 
9
9
  Cr-Commit-Position: refs/heads/master@{#292272}
10
10
  Tech-Debt-Introduced: 17 microMSOffices
@@ -9,7 +9,7 @@ include::_git-retry_desc.helper.txt[]
9
9
  SYNOPSIS
10
10
  --------
11
11
  [verse]
12
- 'git retry' [-v] [-c COUNT] [-d DELAY] [-e] -- _<git_subcommand>_
12
+ 'git retry' [-v] [-c COUNT] [-d DELAY] [-D DELAY_FACTOR] -- _<git_subcommand>_
13
13
 
14
14
  DESCRIPTION
15
15
  -----------
@@ -17,7 +17,7 @@ DESCRIPTION
17
17
  `git squash-branch` is a simple helper command. It takes all the commits on the
18
18
  current branch from the 'merge_base' to HEAD, and reduces them to a single
19
19
  commit. The new commit will contain a summary of all the commits which were
20
- squashed, preceeded by a header message indicating that it's the result of a
20
+ squashed, preceded by a header message indicating that it's the result of a
21
21
  squash (or the message you pass on the command line.).
22
22
 
23
23
  Squashing branches is useful when trying to rebase-update over branches which
@@ -35,7 +35,7 @@ OPTIONS
35
35
  -m <message>::
36
36
  --message=<message>::
37
37
  Optional message to use for the first line of the squashed commit. If omitted,
38
- it defaults to "git squash commit.".
38
+ it defaults to "git squash commit for <branch>.".
39
39
 
40
40
  EXAMPLE
41
41
  -------
@@ -14,7 +14,7 @@ SYNOPSIS
14
14
  DESCRIPTION
15
15
  -----------
16
16
 
17
- Shows a diff beween your current branch and it's upstream. This is 'roughly' the
17
+ Shows a diff between your current branch and it's upstream. This is 'roughly' the
18
18
  same as:
19
19
 
20
20
  ----
@@ -46,14 +46,14 @@ import auth
46
46
  from third_party import httplib2
47
47
 
48
48
  try:
49
- from dateutil.relativedelta import relativedelta # pylint: disable=F0401
49
+ from dateutil.relativedelta import relativedelta # pylint: disable=import-error
50
50
  except ImportError:
51
51
  print 'python-dateutil package required'
52
52
  exit(1)
53
53
 
54
54
  # python-keyring provides easy access to the system keyring.
55
55
  try:
56
- import keyring # pylint: disable=W0611,F0401
56
+ import keyring # pylint: disable=unused-import,F0401
57
57
  except ImportError:
58
58
  print 'Consider installing python-keyring'
59
59
 
@@ -433,6 +433,9 @@ class MyActivity(object):
433
433
  instance["name"], item["id"]),
434
434
  "comments": []
435
435
  }
436
+ if 'shorturl' in instance:
437
+ issue['url'] = 'http://%s/%d' % (instance['shorturl'], item['id'])
438
+
436
439
  if 'owner' in item:
437
440
  issue['owner'] = item['owner']['name']
438
441
  else:
@@ -665,7 +668,7 @@ def main():
665
668
 
666
669
  # Remove description formatting
667
670
  parser.format_description = (
668
- lambda _: parser.description) # pylint: disable=E1101
671
+ lambda _: parser.description) # pylint: disable=no-member
669
672
 
670
673
  options, args = parser.parse_args()
671
674
  options.local_user = os.environ.get('USER')
@@ -338,7 +338,7 @@ def main():
338
338
  auth.add_auth_options(parser)
339
339
  # Remove description formatting
340
340
  parser.format_description = (
341
- lambda _: parser.description) # pylint: disable=E1101
341
+ lambda _: parser.description) # pylint: disable=no-member
342
342
  options, args = parser.parse_args()
343
343
  auth_config = auth.extract_auth_config_from_options(options)
344
344
  if args:
@@ -12,7 +12,7 @@ cat <<-EOF
12
12
  No prebuilt ninja binary was found for this system.
13
13
  Try building your own binary by doing:
14
14
  cd ~
15
- git clone https://github.com/martine/ninja.git -b v1.7.1
15
+ git clone https://github.com/martine/ninja.git -b v1.7.2
16
16
  cd ninja && ./configure.py --bootstrap
17
17
  Then add ~/ninja/ to your PATH.
18
18
  EOF
@@ -25,7 +25,7 @@ case "$OS" in
25
25
  i?86|x86_64)
26
26
  LONG_BIT=$(getconf LONG_BIT)
27
27
  # We know we are on x86 but we need to use getconf to determine
28
- # bittage of the userspace install (e.g. when runing 32-bit userspace
28
+ # bittage of the userspace install (e.g. when running 32-bit userspace
29
29
  # on x86_64 kernel)
30
30
  exec "${THIS_DIR}/ninja-linux${LONG_BIT}" "$@";;
31
31
  *)
Binary file
Binary file
Binary file
Binary file
@@ -71,7 +71,7 @@ BASIC_EMAIL_REGEXP = r'^[\w\-\+\%\.]+\@[\w\-\+\%\.]+$'
71
71
  def _assert_is_collection(obj):
72
72
  assert not isinstance(obj, basestring)
73
73
  # Module 'collections' has no 'Iterable' member
74
- # pylint: disable=E1101
74
+ # pylint: disable=no-member
75
75
  if hasattr(collections, 'Iterable') and hasattr(collections, 'Sized'):
76
76
  assert (isinstance(obj, collections.Iterable) and
77
77
  isinstance(obj, collections.Sized))
@@ -118,6 +118,9 @@ class Database(object):
118
118
  # Mapping reviewers to the preceding comment per file in the OWNERS files.
119
119
  self.comments = {}
120
120
 
121
+ # Cache of compiled regexes for _fnmatch()
122
+ self._fnmatch_cache = {}
123
+
121
124
  # Set of paths that stop us from looking above them for owners.
122
125
  # (This is implicitly true for the root directory).
123
126
  self._stop_looking = set([''])
@@ -197,13 +200,13 @@ class Database(object):
197
200
  dirpath = self.os_path.dirname(dirpath)
198
201
 
199
202
  def _should_stop_looking(self, objname):
200
- return any(fnmatch.fnmatch(objname, stop_looking)
203
+ return any(self._fnmatch(objname, stop_looking)
201
204
  for stop_looking in self._stop_looking)
202
205
 
203
206
  def _owners_for(self, objname):
204
207
  obj_owners = set()
205
208
  for owned_path, path_owners in self._paths_to_owners.iteritems():
206
- if fnmatch.fnmatch(objname, owned_path):
209
+ if self._fnmatch(objname, owned_path):
207
210
  obj_owners |= path_owners
208
211
  return obj_owners
209
212
 
@@ -339,6 +342,14 @@ class Database(object):
339
342
  distance += 1
340
343
  return all_possible_owners
341
344
 
345
+ def _fnmatch(self, filename, pattern):
346
+ """Same as fnmatch.fnmatch(), but interally caches the compiled regexes."""
347
+ matcher = self._fnmatch_cache.get(pattern)
348
+ if matcher is None:
349
+ matcher = re.compile(fnmatch.translate(pattern)).match
350
+ self._fnmatch_cache[pattern] = matcher
351
+ return matcher(filename)
352
+
342
353
  @staticmethod
343
354
  def total_costs_by_owner(all_possible_owners, dirs):
344
355
  # We want to minimize both the number of reviewers and the distance
@@ -106,6 +106,33 @@ def CheckChangeWasUploaded(input_api, output_api):
106
106
 
107
107
  ### Content checks
108
108
 
109
+ def CheckAuthorizedAuthor(input_api, output_api):
110
+ """For non-googler/chromites committers, verify the author's email address is
111
+ in AUTHORS.
112
+ """
113
+ author = input_api.change.author_email
114
+ if not author:
115
+ input_api.logging.info('No author, skipping AUTHOR check')
116
+ return []
117
+ authors_path = input_api.os_path.join(
118
+ input_api.PresubmitLocalPath(), 'AUTHORS')
119
+ valid_authors = (
120
+ input_api.re.match(r'[^#]+\s+\<(.+?)\>\s*$', line)
121
+ for line in open(authors_path))
122
+ valid_authors = [item.group(1).lower() for item in valid_authors if item]
123
+ if not any(input_api.fnmatch.fnmatch(author.lower(), valid)
124
+ for valid in valid_authors):
125
+ input_api.logging.info('Valid authors are %s', ', '.join(valid_authors))
126
+ return [output_api.PresubmitPromptWarning(
127
+ ('%s is not in AUTHORS file. If you are a new contributor, please visit'
128
+ '\n'
129
+ 'http://www.chromium.org/developers/contributing-code and read the '
130
+ '"Legal" section\n'
131
+ 'If you are a chromite, verify the contributor signed the CLA.') %
132
+ author)]
133
+ return []
134
+
135
+
109
136
  def CheckDoNotSubmitInFiles(input_api, output_api):
110
137
  """Checks that the user didn't add 'DO NOT ''SUBMIT' to any files."""
111
138
  # We want to check every text file, not just source files.
@@ -127,7 +154,7 @@ def CheckChangeLintsClean(input_api, output_api, source_file_filter=None,
127
154
 
128
155
  cpplint = input_api.cpplint
129
156
  # Access to a protected member _XX of a client class
130
- # pylint: disable=W0212
157
+ # pylint: disable=protected-access
131
158
  cpplint._cpplint_state.ResetErrorCounts()
132
159
 
133
160
  lint_filters = lint_filters or DEFAULT_LINT_FILTERS
@@ -420,53 +447,6 @@ def CheckLicense(input_api, output_api, license_re, source_file_filter=None,
420
447
  return []
421
448
 
422
449
 
423
- def CheckChangeSvnEolStyle(input_api, output_api, source_file_filter=None):
424
- """Checks that the source files have svn:eol-style=LF."""
425
- return CheckSvnProperty(input_api, output_api,
426
- 'svn:eol-style', 'LF',
427
- input_api.AffectedSourceFiles(source_file_filter))
428
-
429
-
430
- def CheckSvnForCommonMimeTypes(input_api, output_api):
431
- """Checks that common binary file types have the correct svn:mime-type."""
432
- output = []
433
- files = input_api.AffectedFiles(include_deletes=False)
434
- def IsExts(x, exts):
435
- path = x.LocalPath()
436
- for extension in exts:
437
- if path.endswith(extension):
438
- return True
439
- return False
440
- def FilterFiles(extension):
441
- return filter(lambda x: IsExts(x, extension), files)
442
- def RunCheck(mime_type, files):
443
- output.extend(CheckSvnProperty(input_api, output_api, 'svn:mime-type',
444
- mime_type, files))
445
- RunCheck('application/pdf', FilterFiles(['.pdf']))
446
- RunCheck('image/bmp', FilterFiles(['.bmp']))
447
- RunCheck('image/gif', FilterFiles(['.gif']))
448
- RunCheck('image/png', FilterFiles(['.png']))
449
- RunCheck('image/jpeg', FilterFiles(['.jpg', '.jpeg', '.jpe']))
450
- RunCheck('image/vnd.microsoft.icon', FilterFiles(['.ico']))
451
- return output
452
-
453
-
454
- def CheckSvnProperty(input_api, output_api, prop, expected, affected_files):
455
- """Checks that affected_files files have prop=expected."""
456
- if input_api.change.scm != 'svn':
457
- return []
458
-
459
- bad = filter(lambda f: f.Property(prop) != expected, affected_files)
460
- if bad:
461
- if input_api.is_committing:
462
- res_type = output_api.PresubmitError
463
- else:
464
- res_type = output_api.PresubmitNotifyResult
465
- message = 'Run the command: svn pset %s %s \\' % (prop, expected)
466
- return [res_type(message, items=bad)]
467
- return []
468
-
469
-
470
450
  ### Other checks
471
451
 
472
452
  def CheckDoNotSubmit(input_api, output_api):
@@ -878,18 +858,19 @@ def CheckOwners(input_api, output_api, source_file_filter=None):
878
858
  if input_api.tbr:
879
859
  return [output_api.PresubmitNotifyResult(
880
860
  '--tbr was specified, skipping OWNERS check')]
861
+ needed = 'LGTM from an OWNER'
862
+ output_fn = output_api.PresubmitError
881
863
  if input_api.change.issue:
882
864
  if input_api.dry_run:
883
- return [output_api.PresubmitNotifyResult(
884
- 'This is a dry run, skipping OWNERS check')]
865
+ output_fn = lambda text: output_api.PresubmitNotifyResult(
866
+ 'This is a dry run, but these failures would be reported on ' +
867
+ 'commit:\n' + text)
885
868
  else:
886
869
  return [output_api.PresubmitError("OWNERS check failed: this change has "
887
870
  "no Rietveld issue number, so we can't check it for approvals.")]
888
- needed = 'LGTM from an OWNER'
889
- output = output_api.PresubmitError
890
871
  else:
891
872
  needed = 'OWNER reviewers'
892
- output = output_api.PresubmitNotifyResult
873
+ output_fn = output_api.PresubmitNotifyResult
893
874
 
894
875
  affected_files = set([f.LocalPath() for f in
895
876
  input_api.change.AffectedFiles(file_filter=source_file_filter)])
@@ -911,17 +892,17 @@ def CheckOwners(input_api, output_api, source_file_filter=None):
911
892
 
912
893
  if missing_files:
913
894
  output_list = [
914
- output('Missing %s for these files:\n %s' %
915
- (needed, '\n '.join(sorted(missing_files))))]
895
+ output_fn('Missing %s for these files:\n %s' %
896
+ (needed, '\n '.join(sorted(missing_files))))]
916
897
  if not input_api.is_committing:
917
898
  suggested_owners = owners_db.reviewers_for(missing_files, owner_email)
918
- output_list.append(output('Suggested OWNERS: ' +
899
+ output_list.append(output_fn('Suggested OWNERS: ' +
919
900
  '(Use "git-cl owners" to interactively select owners.)\n %s' %
920
901
  ('\n '.join(suggested_owners or []))))
921
902
  return output_list
922
903
 
923
904
  if input_api.is_committing and not reviewers:
924
- return [output('Missing LGTM from someone other than %s' % owner_email)]
905
+ return [output_fn('Missing LGTM from someone other than %s' % owner_email)]
925
906
  return []
926
907
 
927
908
  def GetCodereviewOwnerAndReviewers(input_api, email_regexp, approval_needed):
@@ -1124,17 +1105,11 @@ def PanProjectChecks(input_api, output_api,
1124
1105
  snapshot("checking nsobjects")
1125
1106
  results.extend(_CheckConstNSObject(
1126
1107
  input_api, output_api, source_file_filter=sources))
1127
- snapshot("checking eol style")
1128
- results.extend(input_api.canned_checks.CheckChangeSvnEolStyle(
1129
- input_api, output_api, source_file_filter=text_files))
1130
1108
  snapshot("checking license")
1131
1109
  results.extend(input_api.canned_checks.CheckLicense(
1132
1110
  input_api, output_api, license_header, source_file_filter=sources))
1133
1111
 
1134
1112
  if input_api.is_committing:
1135
- snapshot("checking svn mime types")
1136
- results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes(
1137
- input_api, output_api))
1138
1113
  snapshot("checking was uploaded")
1139
1114
  results.extend(input_api.canned_checks.CheckChangeWasUploaded(
1140
1115
  input_api, output_api))
@@ -1150,9 +1125,13 @@ def PanProjectChecks(input_api, output_api,
1150
1125
  return results
1151
1126
 
1152
1127
 
1153
- def CheckPatchFormatted(input_api, output_api):
1128
+ def CheckPatchFormatted(input_api, output_api, check_js=False):
1154
1129
  import git_cl
1155
- cmd = ['cl', 'format', '--dry-run', input_api.PresubmitLocalPath()]
1130
+ cmd = ['cl', 'format', '--dry-run']
1131
+ if check_js:
1132
+ cmd.append('--js')
1133
+ cmd.append(input_api.PresubmitLocalPath())
1134
+
1156
1135
  code, _ = git_cl.RunGitWithCode(cmd, suppress_stderr=True)
1157
1136
  if code == 2:
1158
1137
  short_path = input_api.basename(input_api.PresubmitLocalPath())
@@ -1160,8 +1139,8 @@ def CheckPatchFormatted(input_api, output_api):
1160
1139
  input_api.change.RepositoryRoot())
1161
1140
  return [output_api.PresubmitPromptWarning(
1162
1141
  'The %s directory requires source formatting. '
1163
- 'Please run git cl format %s' %
1164
- (short_path, full_path))]
1142
+ 'Please run git cl format %s%s' %
1143
+ (short_path, '--js ' if check_js else '', full_path))]
1165
1144
  # As this is just a warning, ignore all other errors if the user
1166
1145
  # happens to have a broken clang-format, doesn't use git, etc etc.
1167
1146
  return []
@@ -197,9 +197,16 @@ class GerritAccessor(object):
197
197
 
198
198
  def _FetchChangeDetail(self, issue):
199
199
  # Separate function to be easily mocked in tests.
200
- return gerrit_util.GetChangeDetail(
201
- self.host, str(issue),
202
- ['ALL_REVISIONS', 'DETAILED_LABELS'])
200
+ try:
201
+ return gerrit_util.GetChangeDetail(
202
+ self.host, str(issue),
203
+ ['ALL_REVISIONS', 'DETAILED_LABELS', 'ALL_COMMITS'],
204
+ ignore_404=False)
205
+ except gerrit_util.GerritError as e:
206
+ if e.http_status == 404:
207
+ raise Exception('Either Gerrit issue %s doesn\'t exist, or '
208
+ 'no credentials to fetch issue details' % issue)
209
+ raise
203
210
 
204
211
  def GetChangeInfo(self, issue):
205
212
  """Returns labels and all revisions (patchsets) for this issue.
@@ -233,12 +240,7 @@ class GerritAccessor(object):
233
240
  rev = info['current_revision']
234
241
  rev_info = info['revisions'][rev]
235
242
 
236
- # Updates revision info, which is part of cached issue info.
237
- if 'real_description' not in rev_info:
238
- rev_info['real_description'] = (
239
- gerrit_util.GetChangeDescriptionFromGitiles(
240
- rev_info['fetch']['http']['url'], rev))
241
- return rev_info['real_description']
243
+ return rev_info['commit']['message']
242
244
 
243
245
  def GetChangeOwner(self, issue):
244
246
  return self.GetChangeInfo(issue)['owner']['email']
@@ -246,7 +248,7 @@ class GerritAccessor(object):
246
248
  def GetChangeReviewers(self, issue, approving_only=True):
247
249
  cr = self.GetChangeInfo(issue)['labels']['Code-Review']
248
250
  max_value = max(int(k) for k in cr['values'].keys())
249
- return [r['email'] for r in cr['all']
251
+ return [r.get('email') for r in cr.get('all', [])
250
252
  if not approving_only or r.get('value', 0) == max_value]
251
253
 
252
254
 
@@ -269,13 +271,45 @@ class OutputApi(object):
269
271
  return self.PresubmitNotifyResult(*args, **kwargs)
270
272
  return self.PresubmitPromptWarning(*args, **kwargs)
271
273
 
274
+ def EnsureCQIncludeTrybotsAreAdded(self, cl, bots_to_include, message):
275
+ """Helper for any PostUploadHook wishing to add CQ_INCLUDE_TRYBOTS.
276
+
277
+ Merges the bots_to_include into the current CQ_INCLUDE_TRYBOTS list,
278
+ keeping it alphabetically sorted. Returns the results that should be
279
+ returned from the PostUploadHook.
280
+
281
+ Args:
282
+ cl: The git_cl.Changelist object.
283
+ bots_to_include: A list of strings of bots to include, in the form
284
+ "master:slave".
285
+ message: A message to be printed in the case that
286
+ CQ_INCLUDE_TRYBOTS was updated.
287
+ """
288
+ description = cl.GetDescription(force=True)
289
+ all_bots = []
290
+ include_re = re.compile(r'^CQ_INCLUDE_TRYBOTS=(.*)', re.M | re.I)
291
+ m = include_re.search(description)
292
+ if m:
293
+ all_bots = [i.strip() for i in m.group(1).split(';') if i.strip()]
294
+ if set(all_bots) >= set(bots_to_include):
295
+ return []
296
+ # Sort the bots to keep them in some consistent order -- not required.
297
+ all_bots = sorted(set(all_bots) | set(bots_to_include))
298
+ new_include_trybots = 'CQ_INCLUDE_TRYBOTS=%s' % ';'.join(all_bots)
299
+ if m:
300
+ new_description = include_re.sub(new_include_trybots, description)
301
+ else:
302
+ new_description = description + '\n' + new_include_trybots + '\n'
303
+ cl.UpdateDescription(new_description, force=True)
304
+ return [self.PresubmitNotifyResult(message)]
305
+
272
306
 
273
307
  class InputApi(object):
274
308
  """An instance of this object is passed to presubmit scripts so they can
275
309
  know stuff about the change they're looking at.
276
310
  """
277
311
  # Method could be a function
278
- # pylint: disable=R0201
312
+ # pylint: disable=no-self-use
279
313
 
280
314
  # File extensions that are considered source files from a style guide
281
315
  # perspective. Don't modify this list from a presubmit script!
@@ -394,7 +428,7 @@ class InputApi(object):
394
428
  # Replace <hash_map> and <hash_set> as headers that need to be included
395
429
  # with "base/containers/hash_tables.h" instead.
396
430
  # Access to a protected member _XX of a client class
397
- # pylint: disable=W0212
431
+ # pylint: disable=protected-access
398
432
  self.cpplint._re_pattern_templates = [
399
433
  (a, b, 'base/containers/hash_tables.h')
400
434
  if header in ('<hash_map>', '<hash_set>') else (a, b, header)
@@ -411,35 +445,7 @@ class InputApi(object):
411
445
  """
412
446
  return self._current_presubmit_path
413
447
 
414
- def DepotToLocalPath(self, depot_path):
415
- """Translate a depot path to a local path (relative to client root).
416
-
417
- Args:
418
- Depot path as a string.
419
-
420
- Returns:
421
- The local path of the depot path under the user's current client, or None
422
- if the file is not mapped.
423
-
424
- Remember to check for the None case and show an appropriate error!
425
- """
426
- return scm.SVN.CaptureLocalInfo([depot_path], self.change.RepositoryRoot()
427
- ).get('Path')
428
-
429
- def LocalToDepotPath(self, local_path):
430
- """Translate a local path to a depot path.
431
-
432
- Args:
433
- Local path (relative to current directory, or absolute) as a string.
434
-
435
- Returns:
436
- The depot path (SVN URL) of the file if mapped, otherwise None.
437
- """
438
- return scm.SVN.CaptureLocalInfo([local_path], self.change.RepositoryRoot()
439
- ).get('URL')
440
-
441
- def AffectedFiles(self, include_dirs=False, include_deletes=True,
442
- file_filter=None):
448
+ def AffectedFiles(self, include_deletes=True, file_filter=None):
443
449
  """Same as input_api.change.AffectedFiles() except only lists files
444
450
  (and optionally directories) in the same directory as the current presubmit
445
451
  script, or subdirectories thereof.
@@ -450,34 +456,34 @@ class InputApi(object):
450
456
 
451
457
  return filter(
452
458
  lambda x: normpath(x.AbsoluteLocalPath()).startswith(dir_with_slash),
453
- self.change.AffectedFiles(include_dirs, include_deletes, file_filter))
459
+ self.change.AffectedFiles(include_deletes, file_filter))
454
460
 
455
- def LocalPaths(self, include_dirs=False):
461
+ def LocalPaths(self):
456
462
  """Returns local paths of input_api.AffectedFiles()."""
457
- paths = [af.LocalPath() for af in self.AffectedFiles(include_dirs)]
463
+ paths = [af.LocalPath() for af in self.AffectedFiles()]
458
464
  logging.debug("LocalPaths: %s", paths)
459
465
  return paths
460
466
 
461
- def AbsoluteLocalPaths(self, include_dirs=False):
467
+ def AbsoluteLocalPaths(self):
462
468
  """Returns absolute local paths of input_api.AffectedFiles()."""
463
- return [af.AbsoluteLocalPath() for af in self.AffectedFiles(include_dirs)]
464
-
465
- def ServerPaths(self, include_dirs=False):
466
- """Returns server paths of input_api.AffectedFiles()."""
467
- return [af.ServerPath() for af in self.AffectedFiles(include_dirs)]
469
+ return [af.AbsoluteLocalPath() for af in self.AffectedFiles()]
468
470
 
469
- def AffectedTextFiles(self, include_deletes=None):
470
- """Same as input_api.change.AffectedTextFiles() except only lists files
471
+ def AffectedTestableFiles(self, include_deletes=None):
472
+ """Same as input_api.change.AffectedTestableFiles() except only lists files
471
473
  in the same directory as the current presubmit script, or subdirectories
472
474
  thereof.
473
475
  """
474
476
  if include_deletes is not None:
475
- warn("AffectedTextFiles(include_deletes=%s)"
477
+ warn("AffectedTestableFiles(include_deletes=%s)"
476
478
  " is deprecated and ignored" % str(include_deletes),
477
479
  category=DeprecationWarning,
478
480
  stacklevel=2)
479
- return filter(lambda x: x.IsTextFile(),
480
- self.AffectedFiles(include_dirs=False, include_deletes=False))
481
+ return filter(lambda x: x.IsTestableFile(),
482
+ self.AffectedFiles(include_deletes=False))
483
+
484
+ def AffectedTextFiles(self, include_deletes=None):
485
+ """An alias to AffectedTestableFiles for backwards compatibility."""
486
+ return self.AffectedTestableFiles(include_deletes=include_deletes)
481
487
 
482
488
  def FilterSourceFile(self, affected_file, white_list=None, black_list=None):
483
489
  """Filters out files that aren't considered "source file".
@@ -494,20 +500,19 @@ class InputApi(object):
494
500
  local_path = affected_file.LocalPath()
495
501
  for item in items:
496
502
  if self.re.match(item, local_path):
497
- logging.debug("%s matched %s", item, local_path)
498
503
  return True
499
504
  return False
500
505
  return (Find(affected_file, white_list or self.DEFAULT_WHITE_LIST) and
501
506
  not Find(affected_file, black_list or self.DEFAULT_BLACK_LIST))
502
507
 
503
508
  def AffectedSourceFiles(self, source_file):
504
- """Filter the list of AffectedTextFiles by the function source_file.
509
+ """Filter the list of AffectedTestableFiles by the function source_file.
505
510
 
506
511
  If source_file is None, InputApi.FilterSourceFile() is used.
507
512
  """
508
513
  if not source_file:
509
514
  source_file = self.FilterSourceFile
510
- return filter(source_file, self.AffectedTextFiles())
515
+ return filter(source_file, self.AffectedTestableFiles())
511
516
 
512
517
  def RightHandSideLines(self, source_file_filter=None):
513
518
  """An iterator over all text lines in "new" version of changed files.
@@ -580,19 +585,6 @@ class _DiffCache(object):
580
585
  raise NotImplementedError()
581
586
 
582
587
 
583
- class _SvnDiffCache(_DiffCache):
584
- """DiffCache implementation for subversion."""
585
- def __init__(self, *args, **kwargs):
586
- super(_SvnDiffCache, self).__init__(*args, **kwargs)
587
- self._diffs_by_file = {}
588
-
589
- def GetDiff(self, path, local_root):
590
- if path not in self._diffs_by_file:
591
- self._diffs_by_file[path] = scm.SVN.GenerateDiff([path], local_root,
592
- False, None)
593
- return self._diffs_by_file[path]
594
-
595
-
596
588
  class _GitDiffCache(_DiffCache):
597
589
  """DiffCache implementation for git; gets all file diffs at once."""
598
590
  def __init__(self, upstream):
@@ -641,25 +633,17 @@ class AffectedFile(object):
641
633
  DIFF_CACHE = _DiffCache
642
634
 
643
635
  # Method could be a function
644
- # pylint: disable=R0201
636
+ # pylint: disable=no-self-use
645
637
  def __init__(self, path, action, repository_root, diff_cache):
646
638
  self._path = path
647
639
  self._action = action
648
640
  self._local_root = repository_root
649
641
  self._is_directory = None
650
- self._properties = {}
651
642
  self._cached_changed_contents = None
652
643
  self._cached_new_contents = None
653
644
  self._diff_cache = diff_cache
654
645
  logging.debug('%s(%s)', self.__class__.__name__, self._path)
655
646
 
656
- def ServerPath(self):
657
- """Returns a path string that identifies the file in the SCM system.
658
-
659
- Returns the empty string if the file does not exist in SCM.
660
- """
661
- return ''
662
-
663
647
  def LocalPath(self):
664
648
  """Returns the path of this file on the local disk relative to client root.
665
649
  """
@@ -670,32 +654,22 @@ class AffectedFile(object):
670
654
  """
671
655
  return os.path.abspath(os.path.join(self._local_root, self.LocalPath()))
672
656
 
673
- def IsDirectory(self):
674
- """Returns true if this object is a directory."""
675
- if self._is_directory is None:
676
- path = self.AbsoluteLocalPath()
677
- self._is_directory = (os.path.exists(path) and
678
- os.path.isdir(path))
679
- return self._is_directory
680
-
681
657
  def Action(self):
682
658
  """Returns the action on this opened file, e.g. A, M, D, etc."""
683
659
  # TODO(maruel): Somewhat crappy, Could be "A" or "A +" for svn but
684
660
  # different for other SCM.
685
661
  return self._action
686
662
 
687
- def Property(self, property_name):
688
- """Returns the specified SCM property of this file, or None if no such
689
- property.
690
- """
691
- return self._properties.get(property_name, None)
692
-
693
- def IsTextFile(self):
663
+ def IsTestableFile(self):
694
664
  """Returns True if the file is a text file and not a binary file.
695
665
 
696
666
  Deleted files are not text file."""
697
667
  raise NotImplementedError() # Implement when needed
698
668
 
669
+ def IsTextFile(self):
670
+ """An alias to IsTestableFile for backwards compatibility."""
671
+ return self.IsTestableFile()
672
+
699
673
  def NewContents(self):
700
674
  """Returns an iterator over the lines in the new version of file.
701
675
 
@@ -707,12 +681,11 @@ class AffectedFile(object):
707
681
  """
708
682
  if self._cached_new_contents is None:
709
683
  self._cached_new_contents = []
710
- if not self.IsDirectory():
711
- try:
712
- self._cached_new_contents = gclient_utils.FileRead(
713
- self.AbsoluteLocalPath(), 'rU').splitlines()
714
- except IOError:
715
- pass # File not found? That's fine; maybe it was deleted.
684
+ try:
685
+ self._cached_new_contents = gclient_utils.FileRead(
686
+ self.AbsoluteLocalPath(), 'rU').splitlines()
687
+ except IOError:
688
+ pass # File not found? That's fine; maybe it was deleted.
716
689
  return self._cached_new_contents[:]
717
690
 
718
691
  def ChangedContents(self):
@@ -728,9 +701,6 @@ class AffectedFile(object):
728
701
  self._cached_changed_contents = []
729
702
  line_num = 0
730
703
 
731
- if self.IsDirectory():
732
- return []
733
-
734
704
  for line in self.GenerateScmDiff().splitlines():
735
705
  m = re.match(r'^@@ [0-9\,\+\-]+ \+([0-9]+)\,[0-9]+ @@', line)
736
706
  if m:
@@ -749,100 +719,26 @@ class AffectedFile(object):
749
719
  return self._diff_cache.GetDiff(self.LocalPath(), self._local_root)
750
720
 
751
721
 
752
- class SvnAffectedFile(AffectedFile):
753
- """Representation of a file in a change out of a Subversion checkout."""
754
- # Method 'NNN' is abstract in class 'NNN' but is not overridden
755
- # pylint: disable=W0223
756
-
757
- DIFF_CACHE = _SvnDiffCache
758
-
759
- def __init__(self, *args, **kwargs):
760
- AffectedFile.__init__(self, *args, **kwargs)
761
- self._server_path = None
762
- self._is_text_file = None
763
-
764
- def ServerPath(self):
765
- if self._server_path is None:
766
- self._server_path = scm.SVN.CaptureLocalInfo(
767
- [self.LocalPath()], self._local_root).get('URL', '')
768
- return self._server_path
769
-
770
- def IsDirectory(self):
771
- if self._is_directory is None:
772
- path = self.AbsoluteLocalPath()
773
- if os.path.exists(path):
774
- # Retrieve directly from the file system; it is much faster than
775
- # querying subversion, especially on Windows.
776
- self._is_directory = os.path.isdir(path)
777
- else:
778
- self._is_directory = scm.SVN.CaptureLocalInfo(
779
- [self.LocalPath()], self._local_root
780
- ).get('Node Kind') in ('dir', 'directory')
781
- return self._is_directory
782
-
783
- def Property(self, property_name):
784
- if not property_name in self._properties:
785
- self._properties[property_name] = scm.SVN.GetFileProperty(
786
- self.LocalPath(), property_name, self._local_root).rstrip()
787
- return self._properties[property_name]
788
-
789
- def IsTextFile(self):
790
- if self._is_text_file is None:
791
- if self.Action() == 'D':
792
- # A deleted file is not a text file.
793
- self._is_text_file = False
794
- elif self.IsDirectory():
795
- self._is_text_file = False
796
- else:
797
- mime_type = scm.SVN.GetFileProperty(
798
- self.LocalPath(), 'svn:mime-type', self._local_root)
799
- self._is_text_file = (not mime_type or mime_type.startswith('text/'))
800
- return self._is_text_file
801
-
802
-
803
722
  class GitAffectedFile(AffectedFile):
804
723
  """Representation of a file in a change out of a git checkout."""
805
724
  # Method 'NNN' is abstract in class 'NNN' but is not overridden
806
- # pylint: disable=W0223
725
+ # pylint: disable=abstract-method
807
726
 
808
727
  DIFF_CACHE = _GitDiffCache
809
728
 
810
729
  def __init__(self, *args, **kwargs):
811
730
  AffectedFile.__init__(self, *args, **kwargs)
812
731
  self._server_path = None
813
- self._is_text_file = None
814
-
815
- def ServerPath(self):
816
- if self._server_path is None:
817
- raise NotImplementedError('TODO(maruel) Implement.')
818
- return self._server_path
819
-
820
- def IsDirectory(self):
821
- if self._is_directory is None:
822
- path = self.AbsoluteLocalPath()
823
- if os.path.exists(path):
824
- # Retrieve directly from the file system; it is much faster than
825
- # querying subversion, especially on Windows.
826
- self._is_directory = os.path.isdir(path)
827
- else:
828
- self._is_directory = False
829
- return self._is_directory
830
-
831
- def Property(self, property_name):
832
- if not property_name in self._properties:
833
- raise NotImplementedError('TODO(maruel) Implement.')
834
- return self._properties[property_name]
732
+ self._is_testable_file = None
835
733
 
836
- def IsTextFile(self):
837
- if self._is_text_file is None:
734
+ def IsTestableFile(self):
735
+ if self._is_testable_file is None:
838
736
  if self.Action() == 'D':
839
- # A deleted file is not a text file.
840
- self._is_text_file = False
841
- elif self.IsDirectory():
842
- self._is_text_file = False
737
+ # A deleted file is not testable.
738
+ self._is_testable_file = False
843
739
  else:
844
- self._is_text_file = os.path.isfile(self.AbsoluteLocalPath())
845
- return self._is_text_file
740
+ self._is_testable_file = os.path.isfile(self.AbsoluteLocalPath())
741
+ return self._is_testable_file
846
742
 
847
743
 
848
744
  class Change(object):
@@ -944,51 +840,44 @@ class Change(object):
944
840
  """List all files under source control in the repo."""
945
841
  raise NotImplementedError()
946
842
 
947
- def AffectedFiles(self, include_dirs=False, include_deletes=True,
948
- file_filter=None):
843
+ def AffectedFiles(self, include_deletes=True, file_filter=None):
949
844
  """Returns a list of AffectedFile instances for all files in the change.
950
845
 
951
846
  Args:
952
847
  include_deletes: If false, deleted files will be filtered out.
953
- include_dirs: True to include directories in the list
954
848
  file_filter: An additional filter to apply.
955
849
 
956
850
  Returns:
957
851
  [AffectedFile(path, action), AffectedFile(path, action)]
958
852
  """
959
- if include_dirs:
960
- affected = self._affected_files
961
- else:
962
- affected = filter(lambda x: not x.IsDirectory(), self._affected_files)
963
-
964
- affected = filter(file_filter, affected)
853
+ affected = filter(file_filter, self._affected_files)
965
854
 
966
855
  if include_deletes:
967
856
  return affected
968
857
  else:
969
858
  return filter(lambda x: x.Action() != 'D', affected)
970
859
 
971
- def AffectedTextFiles(self, include_deletes=None):
860
+ def AffectedTestableFiles(self, include_deletes=None):
972
861
  """Return a list of the existing text files in a change."""
973
862
  if include_deletes is not None:
974
- warn("AffectedTextFiles(include_deletes=%s)"
863
+ warn("AffectedTeestableFiles(include_deletes=%s)"
975
864
  " is deprecated and ignored" % str(include_deletes),
976
865
  category=DeprecationWarning,
977
866
  stacklevel=2)
978
- return filter(lambda x: x.IsTextFile(),
979
- self.AffectedFiles(include_dirs=False, include_deletes=False))
867
+ return filter(lambda x: x.IsTestableFile(),
868
+ self.AffectedFiles(include_deletes=False))
980
869
 
981
- def LocalPaths(self, include_dirs=False):
982
- """Convenience function."""
983
- return [af.LocalPath() for af in self.AffectedFiles(include_dirs)]
870
+ def AffectedTextFiles(self, include_deletes=None):
871
+ """An alias to AffectedTestableFiles for backwards compatibility."""
872
+ return self.AffectedTestableFiles(include_deletes=include_deletes)
984
873
 
985
- def AbsoluteLocalPaths(self, include_dirs=False):
874
+ def LocalPaths(self):
986
875
  """Convenience function."""
987
- return [af.AbsoluteLocalPath() for af in self.AffectedFiles(include_dirs)]
876
+ return [af.LocalPath() for af in self.AffectedFiles()]
988
877
 
989
- def ServerPaths(self, include_dirs=False):
878
+ def AbsoluteLocalPaths(self):
990
879
  """Convenience function."""
991
- return [af.ServerPath() for af in self.AffectedFiles(include_dirs)]
880
+ return [af.AbsoluteLocalPath() for af in self.AffectedFiles()]
992
881
 
993
882
  def RightHandSideLines(self):
994
883
  """An iterator over all text lines in "new" version of changed files.
@@ -1006,19 +895,7 @@ class Change(object):
1006
895
  """
1007
896
  return _RightHandSideLinesImpl(
1008
897
  x for x in self.AffectedFiles(include_deletes=False)
1009
- if x.IsTextFile())
1010
-
1011
-
1012
- class SvnChange(Change):
1013
- _AFFECTED_FILES = SvnAffectedFile
1014
- scm = 'svn'
1015
- _changelists = None
1016
-
1017
- def AllFiles(self, root=None):
1018
- """List all files under source control in the repo."""
1019
- root = root or self.RepositoryRoot()
1020
- return subprocess.check_output(
1021
- ['svn', 'ls', '-R', '.'], cwd=root).splitlines()
898
+ if x.IsTestableFile())
1022
899
 
1023
900
 
1024
901
  class GitChange(Change):
@@ -1085,83 +962,6 @@ def ListRelevantPresubmitFiles(files, root):
1085
962
  return results
1086
963
 
1087
964
 
1088
- class GetTrySlavesExecuter(object):
1089
- @staticmethod
1090
- def ExecPresubmitScript(script_text, presubmit_path, project, change):
1091
- """Executes GetPreferredTrySlaves() from a single presubmit script.
1092
-
1093
- This will soon be deprecated and replaced by GetPreferredTryMasters().
1094
-
1095
- Args:
1096
- script_text: The text of the presubmit script.
1097
- presubmit_path: Project script to run.
1098
- project: Project name to pass to presubmit script for bot selection.
1099
-
1100
- Return:
1101
- A list of try slaves.
1102
- """
1103
- context = {}
1104
- main_path = os.getcwd()
1105
- try:
1106
- os.chdir(os.path.dirname(presubmit_path))
1107
- exec script_text in context
1108
- except Exception, e:
1109
- raise PresubmitFailure('"%s" had an exception.\n%s' % (presubmit_path, e))
1110
- finally:
1111
- os.chdir(main_path)
1112
-
1113
- function_name = 'GetPreferredTrySlaves'
1114
- if function_name in context:
1115
- get_preferred_try_slaves = context[function_name]
1116
- function_info = inspect.getargspec(get_preferred_try_slaves)
1117
- if len(function_info[0]) == 1:
1118
- result = get_preferred_try_slaves(project)
1119
- elif len(function_info[0]) == 2:
1120
- result = get_preferred_try_slaves(project, change)
1121
- else:
1122
- result = get_preferred_try_slaves()
1123
- if not isinstance(result, types.ListType):
1124
- raise PresubmitFailure(
1125
- 'Presubmit functions must return a list, got a %s instead: %s' %
1126
- (type(result), str(result)))
1127
- for item in result:
1128
- if isinstance(item, basestring):
1129
- # Old-style ['bot'] format.
1130
- botname = item
1131
- elif isinstance(item, tuple):
1132
- # New-style [('bot', set(['tests']))] format.
1133
- botname = item[0]
1134
- else:
1135
- raise PresubmitFailure('PRESUBMIT.py returned invalid tryslave/test'
1136
- ' format.')
1137
-
1138
- if botname != botname.strip():
1139
- raise PresubmitFailure(
1140
- 'Try slave names cannot start/end with whitespace')
1141
- if ',' in botname:
1142
- raise PresubmitFailure(
1143
- 'Do not use \',\' separated builder or test names: %s' % botname)
1144
- else:
1145
- result = []
1146
-
1147
- def valid_oldstyle(result):
1148
- return all(isinstance(i, basestring) for i in result)
1149
-
1150
- def valid_newstyle(result):
1151
- return (all(isinstance(i, tuple) for i in result) and
1152
- all(len(i) == 2 for i in result) and
1153
- all(isinstance(i[0], basestring) for i in result) and
1154
- all(isinstance(i[1], set) for i in result)
1155
- )
1156
-
1157
- # Ensure it's either all old-style or all new-style.
1158
- if not valid_oldstyle(result) and not valid_newstyle(result):
1159
- raise PresubmitFailure(
1160
- 'PRESUBMIT.py returned invalid trybot specification!')
1161
-
1162
- return result
1163
-
1164
-
1165
965
  class GetTryMastersExecuter(object):
1166
966
  @staticmethod
1167
967
  def ExecPresubmitScript(script_text, presubmit_path, project, change):
@@ -1223,64 +1023,6 @@ class GetPostUploadExecuter(object):
1223
1023
  return post_upload_hook(cl, change, OutputApi(False))
1224
1024
 
1225
1025
 
1226
- def DoGetTrySlaves(change,
1227
- changed_files,
1228
- repository_root,
1229
- default_presubmit,
1230
- project,
1231
- verbose,
1232
- output_stream):
1233
- """Get the list of try servers from the presubmit scripts (deprecated).
1234
-
1235
- Args:
1236
- changed_files: List of modified files.
1237
- repository_root: The repository root.
1238
- default_presubmit: A default presubmit script to execute in any case.
1239
- project: Optional name of a project used in selecting trybots.
1240
- verbose: Prints debug info.
1241
- output_stream: A stream to write debug output to.
1242
-
1243
- Return:
1244
- List of try slaves
1245
- """
1246
- presubmit_files = ListRelevantPresubmitFiles(changed_files, repository_root)
1247
- if not presubmit_files and verbose:
1248
- output_stream.write("Warning, no PRESUBMIT.py found.\n")
1249
- results = []
1250
- executer = GetTrySlavesExecuter()
1251
-
1252
- if default_presubmit:
1253
- if verbose:
1254
- output_stream.write("Running default presubmit script.\n")
1255
- fake_path = os.path.join(repository_root, 'PRESUBMIT.py')
1256
- results.extend(executer.ExecPresubmitScript(
1257
- default_presubmit, fake_path, project, change))
1258
- for filename in presubmit_files:
1259
- filename = os.path.abspath(filename)
1260
- if verbose:
1261
- output_stream.write("Running %s\n" % filename)
1262
- # Accept CRLF presubmit script.
1263
- presubmit_script = gclient_utils.FileRead(filename, 'rU')
1264
- results.extend(executer.ExecPresubmitScript(
1265
- presubmit_script, filename, project, change))
1266
-
1267
-
1268
- slave_dict = {}
1269
- old_style = filter(lambda x: isinstance(x, basestring), results)
1270
- new_style = filter(lambda x: isinstance(x, tuple), results)
1271
-
1272
- for result in new_style:
1273
- slave_dict.setdefault(result[0], set()).update(result[1])
1274
- slaves = list(slave_dict.items())
1275
-
1276
- slaves.extend(set(old_style))
1277
-
1278
- if slaves and verbose:
1279
- output_stream.write(', '.join((str(x) for x in slaves)))
1280
- output_stream.write('\n')
1281
- return slaves
1282
-
1283
-
1284
1026
  def _MergeMasters(masters1, masters2):
1285
1027
  """Merges two master maps. Merges also the tests of each builder."""
1286
1028
  result = {}
@@ -1459,7 +1201,6 @@ class PresubmitExecuter(object):
1459
1201
  os.chdir(main_path)
1460
1202
  return result
1461
1203
 
1462
-
1463
1204
  def DoPresubmitChecks(change,
1464
1205
  committing,
1465
1206
  verbose,
@@ -1486,7 +1227,8 @@ def DoPresubmitChecks(change,
1486
1227
  output_stream: A stream to write output from presubmit tests to.
1487
1228
  input_stream: A stream to read input from the user.
1488
1229
  default_presubmit: A default presubmit script to execute in any case.
1489
- may_prompt: Enable (y/n) questions on warning or error.
1230
+ may_prompt: Enable (y/n) questions on warning or error. If False,
1231
+ any questions are answered with yes by default.
1490
1232
  rietveld_obj: rietveld.Rietveld object.
1491
1233
  gerrit_obj: provides basic Gerrit codereview functionality.
1492
1234
  dry_run: if true, some Checks will be skipped.
@@ -1512,7 +1254,7 @@ def DoPresubmitChecks(change,
1512
1254
  output.write("Running presubmit upload checks ...\n")
1513
1255
  start_time = time.time()
1514
1256
  presubmit_files = ListRelevantPresubmitFiles(
1515
- change.AbsoluteLocalPaths(True), change.RepositoryRoot())
1257
+ change.AbsoluteLocalPaths(), change.RepositoryRoot())
1516
1258
  if not presubmit_files and verbose:
1517
1259
  output.write("Warning, no PRESUBMIT.py found.\n")
1518
1260
  results = []
@@ -1556,14 +1298,14 @@ def DoPresubmitChecks(change,
1556
1298
  if total_time > 1.0:
1557
1299
  output.write("Presubmit checks took %.1fs to calculate.\n\n" % total_time)
1558
1300
 
1559
- if not errors:
1560
- if not warnings:
1561
- output.write('Presubmit checks passed.\n')
1562
- elif may_prompt:
1563
- output.prompt_yes_no('There were presubmit warnings. '
1564
- 'Are you sure you wish to continue? (y/N): ')
1565
- else:
1566
- output.fail()
1301
+ if errors:
1302
+ output.fail()
1303
+ elif warnings:
1304
+ output.write('There were presubmit warnings. ')
1305
+ if may_prompt:
1306
+ output.prompt_yes_no('Are you sure you wish to continue? (y/N): ')
1307
+ else:
1308
+ output.write('Presubmit checks passed.\n')
1567
1309
 
1568
1310
  global _ASKED_FOR_FEEDBACK
1569
1311
  # Ask for feedback one time out of 5.
@@ -1604,15 +1346,11 @@ def ParseFiles(args, recursive):
1604
1346
 
1605
1347
  def load_files(options, args):
1606
1348
  """Tries to determine the SCM."""
1607
- change_scm = scm.determine_scm(options.root)
1608
1349
  files = []
1609
1350
  if args:
1610
1351
  files = ParseFiles(args, options.recursive)
1611
- if change_scm == 'svn':
1612
- change_class = SvnChange
1613
- if not files:
1614
- files = scm.SVN.CaptureStatus([], options.root)
1615
- elif change_scm == 'git':
1352
+ change_scm = scm.determine_scm(options.root)
1353
+ if change_scm == 'git':
1616
1354
  change_class = GitChange
1617
1355
  upstream = options.upstream or None
1618
1356
  if not files: