libv8 7.4.288.28.0beta1 → 7.8.279.23.0beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +0 -1
  3. data/lib/libv8/version.rb +1 -1
  4. data/vendor/depot_tools/annotated_gclient.py +2 -4
  5. data/vendor/depot_tools/auth.py +0 -2
  6. data/vendor/depot_tools/autoninja +1 -3
  7. data/vendor/depot_tools/autoninja.bat +1 -1
  8. data/vendor/depot_tools/autoninja.py +1 -3
  9. data/vendor/depot_tools/bb +1 -1
  10. data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
  11. data/vendor/depot_tools/buildbucket.py +6 -8
  12. data/vendor/depot_tools/checkout.py +5 -7
  13. data/vendor/depot_tools/cipd +1 -1
  14. data/vendor/depot_tools/cipd_manifest.txt +4 -4
  15. data/vendor/depot_tools/cipd_manifest.versions +80 -80
  16. data/vendor/depot_tools/cit.py +7 -9
  17. data/vendor/depot_tools/clang_format.py +1 -4
  18. data/vendor/depot_tools/clang_format_merge_driver.py +7 -9
  19. data/vendor/depot_tools/compile_single_file.py +1 -3
  20. data/vendor/depot_tools/dart_format.py +2 -4
  21. data/vendor/depot_tools/depot-tools-auth.py +8 -10
  22. data/vendor/depot_tools/fix_encoding.py +2 -5
  23. data/vendor/depot_tools/gclient-new-workdir.py +0 -2
  24. data/vendor/depot_tools/gclient.py +9 -8
  25. data/vendor/depot_tools/gclient_scm.py +28 -54
  26. data/vendor/depot_tools/gclient_utils.py +4 -14
  27. data/vendor/depot_tools/gerrit_util.py +6 -8
  28. data/vendor/depot_tools/git_cache.py +37 -53
  29. data/vendor/depot_tools/git_cl.py +42 -115
  30. data/vendor/depot_tools/git_drover.py +1 -3
  31. data/vendor/depot_tools/git_find_releases.py +6 -8
  32. data/vendor/depot_tools/git_footers.py +5 -7
  33. data/vendor/depot_tools/git_freezer.py +1 -3
  34. data/vendor/depot_tools/git_map_branches.py +5 -7
  35. data/vendor/depot_tools/git_mark_merge_base.py +6 -8
  36. data/vendor/depot_tools/git_nav_downstream.py +5 -7
  37. data/vendor/depot_tools/git_number.py +1 -3
  38. data/vendor/depot_tools/git_rebase_update.py +43 -38
  39. data/vendor/depot_tools/git_reparent_branch.py +6 -8
  40. data/vendor/depot_tools/git_upstream_diff.py +2 -4
  41. data/vendor/depot_tools/gn.py +4 -6
  42. data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
  43. data/vendor/depot_tools/led +1 -1
  44. data/vendor/depot_tools/luci-auth +1 -1
  45. data/vendor/depot_tools/lucicfg +1 -1
  46. data/vendor/depot_tools/mac_toolchain +1 -1
  47. data/vendor/depot_tools/man/html/depot_tools.html +1 -1
  48. data/vendor/depot_tools/man/html/depot_tools_tutorial.html +22 -28
  49. data/vendor/depot_tools/man/html/git-cl.html +1 -1
  50. data/vendor/depot_tools/man/html/git-drover.html +18 -18
  51. data/vendor/depot_tools/man/html/git-footers.html +1 -1
  52. data/vendor/depot_tools/man/html/git-freeze.html +3 -3
  53. data/vendor/depot_tools/man/html/git-hyper-blame.html +1 -1
  54. data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
  55. data/vendor/depot_tools/man/html/git-map.html +1 -1
  56. data/vendor/depot_tools/man/html/git-mark-merge-base.html +1 -1
  57. data/vendor/depot_tools/man/html/git-nav-downstream.html +3 -3
  58. data/vendor/depot_tools/man/html/git-nav-upstream.html +6 -12
  59. data/vendor/depot_tools/man/html/git-new-branch.html +1 -1
  60. data/vendor/depot_tools/man/html/git-rebase-update.html +1 -20
  61. data/vendor/depot_tools/man/html/git-rename-branch.html +1 -1
  62. data/vendor/depot_tools/man/html/git-reparent-branch.html +1 -1
  63. data/vendor/depot_tools/man/html/git-retry.html +1 -1
  64. data/vendor/depot_tools/man/html/git-squash-branch.html +1 -1
  65. data/vendor/depot_tools/man/html/git-thaw.html +1 -1
  66. data/vendor/depot_tools/man/html/git-upstream-diff.html +6 -10
  67. data/vendor/depot_tools/man/man1/git-cl.1 +4 -4
  68. data/vendor/depot_tools/man/man1/git-drover.1 +21 -21
  69. data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
  70. data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
  71. data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
  72. data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
  73. data/vendor/depot_tools/man/man1/git-map.1 +4 -4
  74. data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
  75. data/vendor/depot_tools/man/man1/git-nav-downstream.1 +6 -6
  76. data/vendor/depot_tools/man/man1/git-nav-upstream.1 +9 -15
  77. data/vendor/depot_tools/man/man1/git-new-branch.1 +3 -3
  78. data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -14
  79. data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
  80. data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
  81. data/vendor/depot_tools/man/man1/git-retry.1 +4 -4
  82. data/vendor/depot_tools/man/man1/git-squash-branch.1 +4 -4
  83. data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
  84. data/vendor/depot_tools/man/man1/git-upstream-diff.1 +13 -7
  85. data/vendor/depot_tools/man/man7/depot_tools.7 +4 -4
  86. data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +27 -33
  87. data/vendor/depot_tools/man/src/filter_demo_output.py +1 -3
  88. data/vendor/depot_tools/man/src/git-rebase-update.txt +0 -7
  89. data/vendor/depot_tools/my_activity.py +11 -13
  90. data/vendor/depot_tools/my_reviews.py +29 -34
  91. data/vendor/depot_tools/ninjalog_uploader_wrapper.py +2 -4
  92. data/vendor/depot_tools/owners_finder.py +1 -3
  93. data/vendor/depot_tools/patch.py +1 -1
  94. data/vendor/depot_tools/post_build_ninja_summary.py +15 -17
  95. data/vendor/depot_tools/presubmit_canned_checks.py +1 -3
  96. data/vendor/depot_tools/presubmit_support.py +5 -10
  97. data/vendor/depot_tools/prpc +1 -1
  98. data/vendor/depot_tools/recipes/README.recipes.md +17 -17
  99. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +6 -1
  100. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +4 -2
  101. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +6 -1
  102. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +5 -0
  103. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +4 -2
  104. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +5 -25
  105. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +5 -23
  106. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +5 -23
  107. data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +6 -0
  108. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +1 -0
  109. data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +5 -1
  110. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +6 -1
  111. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +5 -0
  112. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +6 -1
  113. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/set_failure_hash_with_no_steps.json +3 -1
  114. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +6 -4
  115. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +6 -4
  116. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch.json +6 -4
  117. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch_luci.json +6 -4
  118. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +6 -4
  119. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +6 -4
  120. data/vendor/depot_tools/rietveld.py +1 -3
  121. data/vendor/depot_tools/roll_dep.py +0 -2
  122. data/vendor/depot_tools/roll_dep_svn.py +11 -14
  123. data/vendor/depot_tools/scm.py +5 -10
  124. data/vendor/depot_tools/split_cl.py +11 -13
  125. data/vendor/depot_tools/subprocess2.py +1 -1
  126. data/vendor/depot_tools/third_party/colorama/LICENSE.txt +1 -0
  127. data/vendor/depot_tools/third_party/colorama/README.chromium +5 -4
  128. data/vendor/depot_tools/third_party/colorama/README.txt +304 -0
  129. data/vendor/depot_tools/third_party/colorama/__init__.py +4 -3
  130. data/vendor/depot_tools/third_party/colorama/ansi.py +30 -82
  131. data/vendor/depot_tools/third_party/colorama/ansitowin32.py +37 -105
  132. data/vendor/depot_tools/third_party/colorama/initialise.py +15 -39
  133. data/vendor/depot_tools/third_party/colorama/win32.py +28 -46
  134. data/vendor/depot_tools/third_party/colorama/winterm.py +31 -80
  135. data/vendor/depot_tools/third_party/upload.py +1 -1
  136. data/vendor/depot_tools/upload_to_google_storage.py +6 -8
  137. data/vendor/depot_tools/vpython +1 -1
  138. data/vendor/depot_tools/watchlists.py +3 -5
  139. data/vendor/depot_tools/weekly +2 -4
  140. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +36 -38
  141. data/vendor/depot_tools/win_toolchain/package_from_installed.py +8 -10
  142. data/vendor/depot_tools/wtf +3 -5
  143. metadata +3 -3
  144. data/vendor/depot_tools/third_party/colorama/README.rst +0 -346
@@ -14,8 +14,6 @@ This tool does a two things:
14
14
 
15
15
  # TODO(hinoka,iannucci): Pre-pack infra tools in cipd package with vpython spec.
16
16
 
17
- from __future__ import print_function
18
-
19
17
  import argparse
20
18
  import sys
21
19
  import os
@@ -104,20 +102,20 @@ def get_available_tools():
104
102
 
105
103
  def usage():
106
104
  infra_tools, cipd_tools = get_available_tools()
107
- print("""usage: cit.py <name of tool> [args for tool]
105
+ print """usage: cit.py <name of tool> [args for tool]
108
106
 
109
107
  Wrapper for maintaining and calling tools in:
110
108
  "infra.git/run.py infra.tools.*"
111
109
  "infra.git/cipd/*"
112
110
 
113
- Available infra tools are:""")
111
+ Available infra tools are:"""
114
112
  for tool in infra_tools:
115
- print(' * %s' % tool)
113
+ print ' * %s' % tool
116
114
 
117
- print("""
118
- Available cipd tools are:""")
115
+ print """
116
+ Available cipd tools are:"""
119
117
  for tool in cipd_tools:
120
- print(' * %s' % tool)
118
+ print ' * %s' % tool
121
119
 
122
120
 
123
121
  def run(args):
@@ -139,7 +137,7 @@ def run(args):
139
137
  elif os.path.isfile(cipd_file) and is_exe(cipd_file):
140
138
  cmd = [cipd_file]
141
139
  else:
142
- print('Unknown tool "%s"' % tool_name, file=sys.stderr)
140
+ print >>sys.stderr, 'Unknown tool "%s"' % tool_name
143
141
  return usage()
144
142
 
145
143
  # Add the remaining arguments.
@@ -9,8 +9,6 @@ clang-format binaries are pulled down from Google Cloud Storage whenever you
9
9
  sync Chrome, to platform-specific locations. This script knows how to locate
10
10
  those tools, assuming the script is invoked from inside a Chromium checkout."""
11
11
 
12
- from __future__ import print_function
13
-
14
12
  import gclient_paths
15
13
  import os
16
14
  import subprocess
@@ -65,8 +63,7 @@ def main(args):
65
63
  # redirection can be a little opaque.
66
64
  help_syntax = ('-h', '--help', '-help', '-help-list', '--help-list')
67
65
  if any(match in args for match in help_syntax):
68
- print(
69
- '\nDepot tools redirects you to the clang-format at:\n %s\n' % tool)
66
+ print '\nDepot tools redirects you to the clang-format at:\n %s\n' % tool
70
67
 
71
68
  return subprocess.call([tool] + args)
72
69
 
@@ -14,8 +14,6 @@ See https://git-scm.com/docs/gitattributes ("Defining a custom merge
14
14
  driver") for more details.
15
15
  """
16
16
 
17
- from __future__ import print_function
18
-
19
17
  import subprocess
20
18
  import sys
21
19
 
@@ -31,14 +29,14 @@ def main():
31
29
  base, current, others, file_name_in_tree = sys.argv[1:5]
32
30
 
33
31
  if file_name_in_tree == '%P':
34
- print(file=sys.stderr)
35
- print('ERROR: clang-format merge driver needs git 2.5+', file=sys.stderr)
32
+ print >>sys.stderr
33
+ print >>sys.stderr, 'ERROR: clang-format merge driver needs git 2.5+'
36
34
  if sys.platform == 'darwin':
37
- print('Upgrade to Xcode 7.2+', file=sys.stderr)
38
- print(file=sys.stderr)
35
+ print >>sys.stderr, 'Upgrade to Xcode 7.2+'
36
+ print >>sys.stderr
39
37
  return 1
40
38
 
41
- print('Running clang-format 3-way merge driver on ' + file_name_in_tree)
39
+ print 'Running clang-format 3-way merge driver on ' + file_name_in_tree
42
40
 
43
41
  try:
44
42
  tool = clang_format.FindClangFormatToolInChromiumTree()
@@ -58,8 +56,8 @@ def main():
58
56
  with open(fpath, 'wb') as output_file:
59
57
  output_file.write(output)
60
58
  except clang_format.NotFoundError, e:
61
- print(e)
62
- print('Failed to find clang-format. Falling-back on standard 3-way merge')
59
+ print e
60
+ print 'Failed to find clang-format. Falling-back on standard 3-way merge'
63
61
 
64
62
  return subprocess.call(['git', 'merge-file', '-Lcurrent', '-Lbase', '-Lother',
65
63
  current, base, others])
@@ -3,8 +3,6 @@
3
3
  # Use of this source code is governed by a BSD-style license that can be
4
4
  # found in the LICENSE file.
5
5
 
6
- from __future__ import print_function
7
-
8
6
  import argparse
9
7
  import os
10
8
  import subprocess
@@ -49,7 +47,7 @@ def main():
49
47
  abs_build_dir = os.path.join(src_dir, options.build_dir)
50
48
  src_relpath = os.path.relpath(options.file_path, abs_build_dir)
51
49
 
52
- print('Building %s' % options.file_path)
50
+ print 'Building %s' % options.file_path
53
51
 
54
52
  ninja_exec = 'ninja'
55
53
  carets = '^'
@@ -10,8 +10,6 @@ dartfmt binaries are pulled down during gclient sync in the mojo repo.
10
10
  This tool is named dart_format.py instead of dartfmt to parallel
11
11
  clang_format.py, which is in this same repository."""
12
12
 
13
- from __future__ import print_function
14
-
15
13
  import os
16
14
  import subprocess
17
15
  import sys
@@ -44,14 +42,14 @@ def main(args):
44
42
  try:
45
43
  tool = FindDartFmtToolInChromiumTree()
46
44
  except NotFoundError, e:
47
- print(e, file=sys.stderr)
45
+ print >> sys.stderr, e
48
46
  sys.exit(1)
49
47
 
50
48
  # Add some visibility to --help showing where the tool lives, since this
51
49
  # redirection can be a little opaque.
52
50
  help_syntax = ('-h', '--help', '-help', '-help-list', '--help-list')
53
51
  if any(match in args for match in help_syntax):
54
- print('\nDepot tools redirects you to the dartfmt at:\n %s\n' % tool)
52
+ print '\nDepot tools redirects you to the dartfmt at:\n %s\n' % tool
55
53
 
56
54
  return subprocess.call([tool] + sys.argv[1:])
57
55
 
@@ -11,8 +11,6 @@ Usage:
11
11
  depot-tools-auth logout codereview.chromium.org
12
12
  """
13
13
 
14
- from __future__ import print_function
15
-
16
14
  import logging
17
15
  import optparse
18
16
  import sys
@@ -41,7 +39,7 @@ def CMDlogout(parser, args):
41
39
  """Revokes cached authentication token and removes it from disk."""
42
40
  _, authenticator = parser.parse_args(args)
43
41
  done = authenticator.logout()
44
- print('Done.' if done else 'Already logged out.')
42
+ print 'Done.' if done else 'Already logged out.'
45
43
  return 0
46
44
 
47
45
 
@@ -56,12 +54,12 @@ def CMDinfo(parser, args):
56
54
 
57
55
  def print_token_info(hostname, authenticator):
58
56
  token_info = authenticator.get_token_info()
59
- print('Logged in to %s as %s.' % (hostname, token_info['email']))
60
- print('')
61
- print('To login with a different email run:')
62
- print(' depot-tools-auth login %s' % hostname)
63
- print('To logout and purge the authentication token run:')
64
- print(' depot-tools-auth logout %s' % hostname)
57
+ print 'Logged in to %s as %s.' % (hostname, token_info['email'])
58
+ print ''
59
+ print 'To login with a different email run:'
60
+ print ' depot-tools-auth login %s' % hostname
61
+ print 'To logout and purge the authentication token run:'
62
+ print ' depot-tools-auth logout %s' % hostname
65
63
 
66
64
 
67
65
  class OptionParser(optparse.OptionParser):
@@ -91,7 +89,7 @@ def main(argv):
91
89
  try:
92
90
  return dispatcher.execute(OptionParser(), argv)
93
91
  except auth.AuthenticationError as e:
94
- print(e, file=sys.stderr)
92
+ print >> sys.stderr, e
95
93
  return 1
96
94
 
97
95
 
@@ -6,8 +6,6 @@
6
6
  multiple platforms with python.
7
7
  """
8
8
 
9
- from __future__ import print_function
10
-
11
9
  import codecs
12
10
  import locale
13
11
  import os
@@ -24,9 +22,8 @@ def complain(message):
24
22
  to our wrapper. So be paranoid about catching errors and reporting them
25
23
  to sys.__stderr__, so that the user has a higher chance to see them.
26
24
  """
27
- print(
28
- isinstance(message, str) and message or repr(message),
29
- file=sys.__stderr__)
25
+ print >> sys.__stderr__, (
26
+ isinstance(message, str) and message or repr(message))
30
27
 
31
28
 
32
29
  def fix_default_encoding():
@@ -7,8 +7,6 @@
7
7
  # gclient-new-workdir.py [options] <repository> <new_workdir>
8
8
  #
9
9
 
10
- from __future__ import print_function
11
-
12
10
  import argparse
13
11
  import os
14
12
  import shutil
@@ -1650,11 +1650,12 @@ it or fix the checkout.
1650
1650
  # clean checkout.
1651
1651
  gclient_scm.scm.GIT.CleanupDir(par_scm_root, rel_e_dir)
1652
1652
  assert not os.path.exists(os.path.join(e_dir, '.git'))
1653
- print('\nWARNING: \'%s\' has been moved from DEPS to a higher '
1654
- 'level checkout. The git folder containing all the local'
1655
- ' branches has been saved to %s.\n'
1656
- 'If you don\'t care about its state you can safely '
1657
- 'remove that folder to free up space.' % (entry, save_dir))
1653
+ print(('\nWARNING: \'%s\' has been moved from DEPS to a higher '
1654
+ 'level checkout. The git folder containing all the local'
1655
+ ' branches has been saved to %s.\n'
1656
+ 'If you don\'t care about its state you can safely '
1657
+ 'remove that folder to free up space.') %
1658
+ (entry, save_dir))
1658
1659
  continue
1659
1660
 
1660
1661
  if scm_root in full_entries:
@@ -1683,9 +1684,9 @@ it or fix the checkout.
1683
1684
  should_recurse=False,
1684
1685
  relative=None,
1685
1686
  condition=None))
1686
- print('\nWARNING: \'%s\' is no longer part of this client.\n'
1687
- 'It is recommended that you manually remove it or use '
1688
- '\'gclient sync -D\' next time.' % entry_fixed)
1687
+ print(('\nWARNING: \'%s\' is no longer part of this client.\n'
1688
+ 'It is recommended that you manually remove it or use '
1689
+ '\'gclient sync -D\' next time.') % entry_fixed)
1689
1690
  else:
1690
1691
  # Delete the entry
1691
1692
  print('\n________ deleting \'%s\' in \'%s\'' % (
@@ -256,10 +256,9 @@ class GitWrapper(SCMWrapper):
256
256
  def _GetDiffFilenames(self, base):
257
257
  """Returns the names of files modified since base."""
258
258
  return self._Capture(
259
- # Filter to remove base if it is None.
260
- list(filter(bool, ['-c', 'core.quotePath=false', 'diff', '--name-only',
261
- base])
262
- )).split()
259
+ # Filter to remove base if it is None.
260
+ filter(bool, ['-c', 'core.quotePath=false', 'diff', '--name-only', base])
261
+ ).split()
263
262
 
264
263
  def diff(self, options, _args, _file_list):
265
264
  _, revision = gclient_utils.SplitUrlRevision(self.url)
@@ -373,25 +372,25 @@ class GitWrapper(SCMWrapper):
373
372
  'Candidate refs were %s.' % (commit, remote_refs))
374
373
  return None
375
374
 
376
- def apply_patch_ref(self, patch_repo, patch_ref, target_ref, options,
375
+ def apply_patch_ref(self, patch_repo, patch_ref, target_branch, options,
377
376
  file_list):
378
377
  """Apply a patch on top of the revision we're synced at.
379
378
 
380
379
  The patch ref is given by |patch_repo|@|patch_ref|, and the current revision
381
380
  is |base_rev|.
382
- We also need the |target_ref| that the patch was uploaded against. We use
381
+ We also need the |target_branch| that the patch was uploaded against. We use
383
382
  it to find a merge base between |patch_rev| and |base_rev|, so we can find
384
383
  what commits constitute the patch:
385
384
 
386
385
  Graphically, it looks like this:
387
386
 
388
- ... -> merge_base -> [possibly already landed commits] -> target_ref
387
+ ... -> merge_base -> [possibly already landed commits] -> target_branch
389
388
  \
390
389
  -> [possibly not yet landed dependent CLs] -> patch_rev
391
390
 
392
391
  Next, we apply the commits |merge_base..patch_rev| on top of whatever is
393
392
  currently checked out, denoted |base_rev|. Typically, it'd be a revision
394
- from |target_ref|, but this is not required.
393
+ from |target_branch|, but this is not required.
395
394
 
396
395
  Graphically, we cherry pick |merge_base..patch_rev| on top of |base_rev|:
397
396
 
@@ -403,7 +402,7 @@ class GitWrapper(SCMWrapper):
403
402
  Args:
404
403
  patch_repo: The patch origin. e.g. 'https://foo.googlesource.com/bar'
405
404
  patch_ref: The ref to the patch. e.g. 'refs/changes/1234/34/1'.
406
- target_ref: The ref the patch was uploaded against.
405
+ target_branch: The branch the patch was uploaded against.
407
406
  e.g. 'refs/heads/master' or 'refs/heads/infra/config'.
408
407
  options: The options passed to gclient.
409
408
  file_list: A list where modified files will be appended.
@@ -417,49 +416,25 @@ class GitWrapper(SCMWrapper):
417
416
 
418
417
  base_rev = self._Capture(['rev-parse', 'HEAD'])
419
418
 
420
- if not target_ref:
421
- target_ref = self._GetTargetBranchForCommit(base_rev) or base_rev
422
- elif not target_ref.startswith(('refs/heads/', 'refs/branch-heads/')):
423
- # TODO(ehmaldonado): Support all refs.
424
- raise gclient_utils.Error(
425
- 'target_ref must be in refs/heads/** or refs/branch-heads/**. '
426
- 'Got %s instead.' % target_ref)
427
- elif target_ref == 'refs/heads/master':
428
- # We handle refs/heads/master separately because bot_update treats it
429
- # differently than other refs: it will fetch refs/heads/foo to
430
- # refs/heads/foo, but refs/heads/master to refs/remotes/origin/master.
431
- # It's not strictly necessary, but it simplifies the rest of the code.
432
- target_ref = 'refs/remotes/%s/master' % self.remote
433
- elif scm.GIT.IsValidRevision(self.checkout_path, target_ref):
434
- # The target ref for the change is already available, so we don't need to
435
- # do anything.
436
- # This is a common case. When applying a patch to a top-level solution,
437
- # bot_update will fetch the target ref for the change and sync the
438
- # solution to it.
439
- pass
419
+ if target_branch:
420
+ # Convert the target branch to a remote ref if possible.
421
+ remote_ref = scm.GIT.RefToRemoteRef(target_branch, self.remote)
422
+ if remote_ref:
423
+ target_branch = ''.join(remote_ref)
440
424
  else:
441
- # The target ref is not available. We check next for a remote version of
442
- # it (e.g. refs/remotes/origin/<branch>) and fetch it if it's not
443
- # available.
444
- self.Print('%s is not an existing ref.' % target_ref)
445
- original_target_ref = target_ref
446
- target_ref = ''.join(scm.GIT.RefToRemoteRef(target_ref, self.remote))
447
- self.Print('Trying with %s' % target_ref)
448
- if not scm.GIT.IsValidRevision(self.checkout_path, target_ref):
449
- self.Print(
450
- '%s is not an existing ref either. Will proceed to fetch it.'
451
- % target_ref)
452
- url, _ = gclient_utils.SplitUrlRevision(self.url)
453
- mirror = self._GetMirror(url, options, target_ref)
454
- if mirror:
455
- self._UpdateMirrorIfNotContains(
456
- mirror, options, 'branch', target_ref, original_target_ref)
457
- self._Fetch(options, refspec=target_ref)
425
+ target_branch = self._GetTargetBranchForCommit(base_rev)
426
+
427
+ # Fallback to the commit we got.
428
+ # This means that apply_path_ref will try to find the merge-base between the
429
+ # patch and the commit (which is most likely the commit) and cherry-pick
430
+ # everything in between.
431
+ if not target_branch:
432
+ target_branch = base_rev
458
433
 
459
434
  self.Print('===Applying patch ref===')
460
435
  self.Print('Patch ref is %r @ %r. Target branch for patch is %r. '
461
436
  'Current HEAD is %r. Current dir is %r' % (
462
- patch_repo, patch_ref, target_ref, base_rev,
437
+ patch_repo, patch_ref, target_branch, base_rev,
463
438
  self.checkout_path))
464
439
  self._Capture(['reset', '--hard'])
465
440
  self._Capture(['fetch', patch_repo, patch_ref])
@@ -471,9 +446,9 @@ class GitWrapper(SCMWrapper):
471
446
  else:
472
447
  # Find the merge-base between the branch_rev and patch_rev to find out
473
448
  # the changes we need to cherry-pick on top of base_rev.
474
- merge_base = self._Capture(['merge-base', target_ref, patch_rev])
449
+ merge_base = self._Capture(['merge-base', target_branch, patch_rev])
475
450
  self.Print('Merge base of %s and %s is %s' % (
476
- target_ref, patch_rev, merge_base))
451
+ target_branch, patch_rev, merge_base))
477
452
  if merge_base == patch_rev:
478
453
  # If the merge-base is patch_rev, it means patch_rev is already part
479
454
  # of the history, so just check it out.
@@ -492,9 +467,9 @@ class GitWrapper(SCMWrapper):
492
467
 
493
468
  except subprocess2.CalledProcessError as e:
494
469
  self.Print('Failed to apply patch.')
495
- self.Print('Patch ref is %r @ %r. Target ref for patch is %r. '
470
+ self.Print('Patch ref is %r @ %r. Target branch for patch is %r. '
496
471
  'Current HEAD is %r. Current dir is %r' % (
497
- patch_repo, patch_ref, target_ref, base_rev,
472
+ patch_repo, patch_ref, target_branch, base_rev,
498
473
  self.checkout_path))
499
474
  self.Print('git returned non-zero exit status %s:\n%s' % (
500
475
  e.returncode, e.stderr))
@@ -631,7 +606,7 @@ class GitWrapper(SCMWrapper):
631
606
  # Skip url auto-correction if remote.origin.gclient-auto-fix-url is set.
632
607
  # This allows devs to use experimental repos which have a different url
633
608
  # but whose branch(s) are the same as official repos.
634
- if (current_url.rstrip('/') != url.rstrip('/') and url != 'git://foo' and
609
+ if (current_url.rstrip(b'/') != url.rstrip('/') and url != 'git://foo' and
635
610
  subprocess2.capture(
636
611
  ['git', 'config', 'remote.%s.gclient-auto-fix-url' % self.remote],
637
612
  cwd=self.checkout_path).strip() != 'False'):
@@ -1307,8 +1282,7 @@ class GitWrapper(SCMWrapper):
1307
1282
  kwargs.setdefault('stderr', subprocess2.PIPE)
1308
1283
  strip = kwargs.pop('strip', True)
1309
1284
  env = scm.GIT.ApplyEnvVars(kwargs)
1310
- ret = subprocess2.check_output(
1311
- ['git'] + args, env=env, **kwargs).decode('utf-8')
1285
+ ret = subprocess2.check_output(['git'] + args, env=env, **kwargs)
1312
1286
  if strip:
1313
1287
  ret = ret.strip()
1314
1288
  return ret
@@ -433,20 +433,10 @@ class Annotated(Wrapper):
433
433
 
434
434
  # Continue lockless.
435
435
  obj[0] += out
436
- while True:
437
- # TODO(agable): find both of these with a single pass.
438
- cr_loc = obj[0].find('\r')
439
- lf_loc = obj[0].find('\n')
440
- if cr_loc == lf_loc == -1:
441
- break
442
- elif cr_loc == -1 or (lf_loc >= 0 and lf_loc < cr_loc):
443
- line, remaining = obj[0].split('\n', 1)
444
- if line:
445
- self._wrapped.write('%d>%s\n' % (index, line))
446
- elif lf_loc == -1 or (cr_loc >= 0 and cr_loc < lf_loc):
447
- line, remaining = obj[0].split('\r', 1)
448
- if line:
449
- self._wrapped.write('%d>%s\r' % (index, line))
436
+ while '\n' in obj[0]:
437
+ line, remaining = obj[0].split('\n', 1)
438
+ if line:
439
+ self._wrapped.write('%d>%s\n' % (index, line))
450
440
  obj[0] = remaining
451
441
 
452
442
  def flush(self):
@@ -8,8 +8,6 @@ Utilities for requesting information for a gerrit server via https.
8
8
  https://gerrit-review.googlesource.com/Documentation/rest-api.html
9
9
  """
10
10
 
11
- from __future__ import print_function
12
-
13
11
  import base64
14
12
  import contextlib
15
13
  import cookielib
@@ -168,10 +166,10 @@ class CookiesAuthenticator(Authenticator):
168
166
 
169
167
  st = os.stat(path)
170
168
  if st.st_mode & (stat.S_IRWXG | stat.S_IRWXO):
171
- print(
169
+ print >> sys.stderr, (
172
170
  'WARNING: netrc file %s cannot be used because its file '
173
171
  'permissions are insecure. netrc file permissions should be '
174
- '600.' % path, file=sys.stderr)
172
+ '600.' % path)
175
173
  with open(path) as fd:
176
174
  content = fd.read()
177
175
 
@@ -191,11 +189,11 @@ class CookiesAuthenticator(Authenticator):
191
189
  try:
192
190
  return netrc.netrc(path)
193
191
  except IOError:
194
- print('WARNING: Could not read netrc file %s' % path, file=sys.stderr)
192
+ print >> sys.stderr, 'WARNING: Could not read netrc file %s' % path
195
193
  return netrc.netrc(os.devnull)
196
194
  except netrc.NetrcParseError as e:
197
- print('ERROR: Cannot use netrc file %s due to a parsing error: %s' %
198
- (path, e), file=sys.stderr)
195
+ print >> sys.stderr, ('ERROR: Cannot use netrc file %s due to a '
196
+ 'parsing error: %s' % (path, e))
199
197
  return netrc.netrc(os.devnull)
200
198
 
201
199
  @classmethod
@@ -788,7 +786,7 @@ def AddReviewers(host, change, reviewers=None, ccs=None, notify=True,
788
786
  'reviewer': r,
789
787
  'state': state,
790
788
  'notify': 'NONE', # We handled `notify` argument above.
791
- })
789
+ })
792
790
 
793
791
  conn = CreateHttpConn(host, path, reqtype='POST', body=body)
794
792
  # Gerrit will return 400 if one or more of the requested reviewers are