gclient flatten: preserve variable placeholders

One of the main use cases is making it clear which revision hashes
need to be changed together. The way it's usually done is one variable
referenced several times. With this CL, we preserve the references
from original DEPS, as opposed to evaluating them and losing some info.

This CL actually makes Var() emit a variable placeholder
instead of its value, and adds support for these placeholders
to gclient.

One of possible next steps might be to deprecate Var().

Bug: 570091
Change-Id: I9b13a691b5203cc284c33a59438720e31c9ebf7a
Reviewed-on: https://chromium-review.googlesource.com/583617
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
5 files changed
tree: af9624bce6c3a03e38b0b2184948e57e5d201600
  1. bootstrap/
  2. fetch_configs/
  3. git-templates/
  4. infra/
  5. man/
  6. recipes/
  7. support/
  8. testing_support/
  9. tests/
  10. third_party/
  11. win_toolchain/
  12. zsh-goodies/
  13. .gitattributes
  14. .gitignore
  15. .style.yapf
  16. annotated_gclient.py
  17. appengine_mapper.py
  18. apply_issue
  19. apply_issue.bat
  20. apply_issue.py
  21. auth.py
  22. autoninja
  23. autoninja.bat
  24. autoninja.py
  25. breakpad.py
  26. buildbucket.py
  27. checkout.py
  28. cipd
  29. cipd.bat
  30. cipd.ps1
  31. cipd_bin_setup.bat
  32. cipd_bin_setup.sh
  33. cipd_client_version
  34. cipd_manifest.txt
  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. commit_queue
  46. commit_queue.bat
  47. commit_queue.py
  48. cpplint.bat
  49. cpplint.py
  50. cpplint_chromium.py
  51. dart_format.py
  52. depot-tools-auth
  53. depot-tools-auth.bat
  54. depot-tools-auth.py
  55. download_from_google_storage
  56. download_from_google_storage.bat
  57. download_from_google_storage.py
  58. fetch
  59. fetch.bat
  60. fetch.py
  61. fix_encoding.py
  62. gclient
  63. gclient-new-workdir.py
  64. gclient.bat
  65. gclient.py
  66. gclient_completion.sh
  67. gclient_eval.py
  68. gclient_scm.py
  69. gclient_utils.py
  70. gerrit_client.py
  71. gerrit_util.py
  72. git-cache
  73. git-cherry-pick-upload
  74. git-cl
  75. git-crrev-parse
  76. git-crsync
  77. git-drover
  78. git-find-releases
  79. git-footers
  80. git-freeze
  81. git-gs
  82. git-hyper-blame
  83. git-map
  84. git-map-branches
  85. git-mark-merge-base
  86. git-nav-downstream
  87. git-nav-upstream
  88. git-new-branch
  89. git-number
  90. git-rebase-update
  91. git-rename-branch
  92. git-reparent-branch
  93. git-retry
  94. git-runhooks
  95. git-squash-branch
  96. git-thaw
  97. git-upstream-diff
  98. git_cache.py
  99. git_cherry_pick_upload.py
  100. git_cl.py
  101. git_cl_completion.sh
  102. git_common.py
  103. git_dates.py
  104. git_drover.py
  105. git_find_releases.py
  106. git_footers.py
  107. git_freezer.py
  108. git_hyper_blame.py
  109. git_map.py
  110. git_map_branches.py
  111. git_mark_merge_base.py
  112. git_nav_downstream.py
  113. git_new_branch.py
  114. git_number.py
  115. git_rebase_update.py
  116. git_rename_branch.py
  117. git_reparent_branch.py
  118. git_retry.py
  119. git_squash_branch.py
  120. git_upstream_diff.py
  121. gn
  122. gn.bat
  123. gn.py
  124. gsutil.py
  125. led
  126. led.bat
  127. LICENSE
  128. my_activity.py
  129. my_reviews.py
  130. ninja
  131. ninja-linux32
  132. ninja-linux64
  133. ninja-mac
  134. ninja.exe
  135. OWNERS
  136. owners.py
  137. owners_finder.py
  138. patch.py
  139. PRESUBMIT.py
  140. presubmit_canned_checks.py
  141. presubmit_support.py
  142. profile.xml
  143. pylint
  144. pylint.py
  145. pylintrc
  146. python_runner.sh
  147. README.gclient.md
  148. README.git-cl.md
  149. README.md
  150. README.testing
  151. repo
  152. rietveld.py
  153. roll-dep
  154. roll-dep-svn
  155. roll-dep-svn.bat
  156. roll-dep.bat
  157. roll_dep.py
  158. roll_dep_svn.py
  159. scm.py
  160. setup_color.py
  161. split_cl.py
  162. subcommand.py
  163. subprocess2.py
  164. update_depot_tools
  165. update_depot_tools.bat
  166. update_depot_tools_toggle.py
  167. upload_to_google_storage.py
  168. vpython
  169. vpython.bat
  170. WATCHLISTS
  171. watchlists.py
  172. weekly
  173. wtf
README.md

depot_tools

Tools for working with Chromium development. It requires python 2.7.

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

To update cpplint.py, please submit the change upstream first at https://github.com/google/styleguide/tree/gh-pages/cpplint then copy it down.