Add previous_got_revision and previous_got_revision_cp to output

As chrome browser infra works to improve CQ times, we would like to
easily glance at builds and see how many new commits were checked out.
Currently you have to open up bot_update stdout to see the previous
HEAD revision and go from there. Having this conveniently outputted
would be very convenient.

If the bot has previously checked out the repo, output which revision
and commit position were checked out.

example LED build showing new output: https://ci.chromium.org/swarming/task/51592e46d6a70e10?server=chromium-swarm.appspot.com

Change-Id: Ib8a6f152a593446ce4082477bc9ada44f1fd1fc3
Bug: 1170568
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2644829
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
1 file changed
tree: 85057421e6d16fd019c2cbc4cbb278c4c88971dd
  1. .cipd_impl.ps1
  2. .gitattributes
  3. .gitignore
  4. .style.yapf
  5. .vpython
  6. .vpython3
  7. CROS_OWNERS
  8. DIR_METADATA
  9. GOMA_OWNERS
  10. LICENSE
  11. LUCI_OWNERS
  12. OWNERS
  13. PRESUBMIT.py
  14. README.gclient.md
  15. README.git-cl.md
  16. README.md
  17. WATCHLISTS
  18. auth.py
  19. autoninja
  20. autoninja.bat
  21. autoninja.py
  22. bb
  23. bb.bat
  24. bootstrap/
  25. bootstrap_python3
  26. breakpad.py
  27. cipd
  28. cipd.bat
  29. cipd_bin_setup.bat
  30. cipd_bin_setup.sh
  31. cipd_client_version
  32. cipd_client_version.digests
  33. cipd_manifest.txt
  34. cipd_manifest.versions
  35. cit
  36. cit.bat
  37. cit.py
  38. clang-format
  39. clang-format.bat
  40. clang_format.py
  41. clang_format_merge_driver
  42. clang_format_merge_driver.bat
  43. clang_format_merge_driver.py
  44. codereview.settings
  45. compile_single_file
  46. compile_single_file.bat
  47. compile_single_file.py
  48. cpplint.bat
  49. cpplint.py
  50. cpplint_chromium.py
  51. cros
  52. crosjobs
  53. detect_host_arch.py
  54. dirmd
  55. dirmd.bat
  56. download_from_google_storage
  57. download_from_google_storage.bat
  58. download_from_google_storage.py
  59. ensure_bootstrap
  60. fetch
  61. fetch.bat
  62. fetch.py
  63. fetch_configs/
  64. fix_encoding.py
  65. gclient
  66. gclient-new-workdir.py
  67. gclient.bat
  68. gclient.py
  69. gclient_completion.sh
  70. gclient_eval.py
  71. gclient_paths.py
  72. gclient_scm.py
  73. gclient_utils.py
  74. gerrit_client.py
  75. gerrit_util.py
  76. git-cache
  77. git-cl
  78. git-crrev-parse
  79. git-drover
  80. git-find-releases
  81. git-footers
  82. git-freeze
  83. git-gs
  84. git-hyper-blame
  85. git-map
  86. git-map-branches
  87. git-mark-merge-base
  88. git-migrate-default-branch
  89. git-nav-downstream
  90. git-nav-upstream
  91. git-new-branch
  92. git-number
  93. git-rebase-update
  94. git-rename-branch
  95. git-reparent-branch
  96. git-retry
  97. git-runhooks
  98. git-squash-branch
  99. git-templates/
  100. git-thaw
  101. git-upstream-diff
  102. git_cache.py
  103. git_cl.py
  104. git_cl_completion.sh
  105. git_common.py
  106. git_dates.py
  107. git_drover.py
  108. git_find_releases.py
  109. git_footers.py
  110. git_freezer.py
  111. git_hyper_blame.py
  112. git_map.py
  113. git_map_branches.py
  114. git_mark_merge_base.py
  115. git_migrate_default_branch.py
  116. git_nav_downstream.py
  117. git_new_branch.py
  118. git_number.py
  119. git_rebase_update.py
  120. git_rename_branch.py
  121. git_reparent_branch.py
  122. git_retry.py
  123. git_squash_branch.py
  124. git_upstream_diff.py
  125. gn
  126. gn.bat
  127. gn.py
  128. goma_auth
  129. goma_auth.bat
  130. goma_ctl
  131. goma_ctl.bat
  132. gsutil.py
  133. gsutil.py.bat
  134. gsutil.vpython
  135. infra/
  136. led
  137. led.bat
  138. lockfile.py
  139. luci-auth
  140. luci-auth.bat
  141. lucicfg
  142. lucicfg.bat
  143. mac_toolchain
  144. man/
  145. metrics.README.md
  146. metrics.py
  147. metrics_utils.py
  148. my_activity.py
  149. ninja
  150. ninja-linux32
  151. ninja-linux64
  152. ninja-mac
  153. ninja.exe
  154. ninjalog.README.md
  155. ninjalog_uploader.py
  156. ninjalog_uploader_wrapper.py
  157. owners.py
  158. owners_client.py
  159. owners_finder.py
  160. post_build_ninja_summary.py
  161. presubmit_canned_checks.py
  162. presubmit_support.py
  163. profile.xml
  164. prpc
  165. prpc.bat
  166. pylint
  167. pylint-1.5
  168. pylint-1.6
  169. pylint-1.7
  170. pylint-1.8
  171. pylint-1.9
  172. pylint-2.6
  173. pylint.bat
  174. pylint_main.py
  175. pylintrc
  176. python-bin/
  177. python2-bin/
  178. python_runner.sh
  179. rdb
  180. rdb.bat
  181. rdb_wrapper.py
  182. recipes/
  183. repo
  184. repo_launcher
  185. roll-dep
  186. roll-dep.bat
  187. roll_dep.py
  188. scm.py
  189. setup_color.py
  190. split_cl.py
  191. subcommand.py
  192. subprocess2.py
  193. testing_support/
  194. tests/
  195. third_party/
  196. update_depot_tools
  197. update_depot_tools.bat
  198. update_depot_tools_toggle.py
  199. upload_metrics.py
  200. upload_to_google_storage.py
  201. vpython
  202. vpython.bat
  203. vpython3
  204. vpython3.bat
  205. watchlists.py
  206. weekly
  207. whitespace.txt
  208. win32imports.py
  209. win_toolchain/
  210. wtf
  211. yapf
  212. yapf.bat
  213. zsh-goodies/
README.md

depot_tools

Tools for working with Chromium development. It requires python 2.7 or 3.8 for python 3 support.

Tools

The most important tools are:

  • fetch: A gclient wrapper to checkout a project. Use fetch --help for more details.
  • gclient: A meta-checkout tool. Think repo or git submodules, except that it support OS-specific rules, e.g. do not checkout Windows only dependencies when checking out for Android. Use gclient help for more details and README.gclient.md.
  • git cl: A code review tool to interact with Rietveld or Gerrit. Use git cl help for more details and README.git-cl.md.
  • roll-dep: A gclient dependency management tool to submit a dep roll, updating a dependency to a newer revision.

There are a lot of git utilities included.

Updating

depot_tools updates itself automatically when running gclient tool. To disable auto update, set the environment variable DEPOT_TOOLS_UPDATE=0.

To update package manually, run update_depot_tools.bat on Windows, or ./update_depot_tools on Linux or Mac.

On Windows only, running gclient will install git and python.

Contributing

To contribute change for review:

git new-branch <somename>
# Hack
git add .
git commit -a -m "Fixes goat teleporting"
# find reviewers
git cl owners
git log -- <yourfiles>

# Request a review.
git cl upload -r reviewer1@chromium.org,reviewer2@chromium.org --send-mail

# Edit change description if needed.
git cl desc

# If change is approved, flag it to be committed.
git cl set-commit

# If change needs more work.
git rebase-update
...
git cl upload -t "Fixes goat teleporter destination to be Australia"

See also open bugs, open reviews, forum or report problems.

cpplint.py

Until 2018, our cpplint.py was a copy of the upstream version at https://github.com/google/styleguide/tree/gh-pages/cpplint. Unfortunately, that repository is not maintained any more. If you want to update cpplint.py in depot_tools, just upload a patch to do so. We will figure out a long-term strategy via issue https://crbug.com/916550.

Note that the cpplint.py here is also used by the Tricium analyzer, so if the cpplint.py here changes, we should also update the copy used there.