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
@@ -309,23 +309,6 @@ class Mirror(object):
309
309
  '$GIT_CACHE_PATH is set.')
310
310
  return ret
311
311
 
312
- @staticmethod
313
- def _GetMostRecentCacheDirectory(ls_out_set):
314
- ready_file_pattern = re.compile(r'.*/(\d+).ready$')
315
- ready_dirs = []
316
-
317
- for name in ls_out_set:
318
- m = ready_file_pattern.match(name)
319
- # Given <path>/<number>.ready,
320
- # we are interested in <path>/<number> directory
321
- if m and (name[:-len('.ready')] + '/') in ls_out_set:
322
- ready_dirs.append((int(m.group(1)), name[:-len('.ready')]))
323
-
324
- if not ready_dirs:
325
- return None
326
-
327
- return max(ready_dirs)[1]
328
-
329
312
  def Rename(self, src, dst):
330
313
  # This is somehow racy on Windows.
331
314
  # Catching OSError because WindowsError isn't portable and
@@ -401,14 +384,26 @@ class Mirror(object):
401
384
  # The .ready file is only uploaded when an entire directory has been
402
385
  # uploaded to GS.
403
386
  _, ls_out, ls_err = gsutil.check_call('ls', self._gs_path)
404
- ls_out_set = set(ls_out.strip().splitlines())
405
- latest_dir = self._GetMostRecentCacheDirectory(ls_out_set)
406
387
 
407
- if not latest_dir:
388
+ ready_file_pattern = re.compile(r'.*/(\d+).ready$')
389
+
390
+ objects = set(ls_out.strip().splitlines())
391
+ ready_dirs = []
392
+
393
+ for name in objects:
394
+ m = ready_file_pattern.match(name)
395
+ # Given <path>/<number>.ready,
396
+ # we are interested in <path>/<number> directory
397
+
398
+ if m and (name[:-len('.ready')] + '/') in objects:
399
+ ready_dirs.append((int(m.group(1)), name[:-len('.ready')]))
400
+
401
+ if not ready_dirs:
408
402
  self.print('No bootstrap file for %s found in %s, stderr:\n %s' %
409
403
  (self.mirror_path, self.bootstrap_bucket,
410
404
  ' '.join((ls_err or '').splitlines(True))))
411
405
  return False
406
+ latest_dir = max(ready_dirs)[1]
412
407
 
413
408
  try:
414
409
  # create new temporary directory locally
@@ -578,49 +573,38 @@ class Mirror(object):
578
573
  gsutil = Gsutil(path=self.gsutil_exe, boto_path=None)
579
574
 
580
575
  src_name = self.mirror_path
581
- dest_prefix = '%s/%s' % (self._gs_path, gen_number)
582
-
583
- # ls_out lists contents in the format: gs://blah/blah/123...
584
- _, ls_out, _ = gsutil.check_call('ls', self._gs_path)
585
-
586
- # Check to see if folder already exists in gs
587
- ls_out_set = set(ls_out.strip().splitlines())
588
- if (dest_prefix + '/' in ls_out_set and
589
- dest_prefix + '.ready' in ls_out_set):
590
- print('Cache %s already exists.' % dest_prefix)
576
+ dest_name = '%s/%s' % (self._gs_path, gen_number)
577
+
578
+ # check to see if folder already exists in gs
579
+ _, ls_out, ls_err = gsutil.check_call('ls', dest_name)
580
+ _, ls_out_ready, ls_err_ready = (
581
+ gsutil.check_call('ls', dest_name + '.ready'))
582
+
583
+ # only printing out errors because the folder/ready file
584
+ # might not exist yet, so it will error no matter what
585
+ if ls_err:
586
+ print('Failed to check GS:\n%s' % (ls_err))
587
+ if ls_err_ready:
588
+ print('Failed to check GS:\n%s' % (ls_err_ready))
589
+
590
+ if not (ls_out == '' and ls_out_ready == ''):
591
+ print('Cache %s already exists' % dest_name)
591
592
  return
592
593
 
593
594
  # Run Garbage Collect to compress packfile.
594
595
  self.RunGit(['gc', '--prune=all'])
595
596
 
596
- gsutil.call('-m', 'cp', '-r', src_name, dest_prefix)
597
+ gsutil.call('-m', 'cp', '-r', src_name, dest_name)
597
598
 
598
- # Create .ready file and upload
599
+ #TODO(karenqian): prune old caches
600
+
601
+ # create .ready file and upload
599
602
  _, ready_file_name = tempfile.mkstemp(suffix='.ready')
600
603
  try:
601
- gsutil.call('cp', ready_file_name, '%s.ready' % (dest_prefix))
604
+ gsutil.call('cp', ready_file_name, '%s.ready' % (dest_name))
602
605
  finally:
603
606
  os.remove(ready_file_name)
604
607
 
605
- # remove all other directory/.ready files in the same gs_path
606
- # except for the directory/.ready file previously created
607
- # which can be used for bootstrapping while the current one is
608
- # being uploaded
609
- if not prune:
610
- return
611
- prev_dest_prefix = self._GetMostRecentCacheDirectory(ls_out_set)
612
- if not prev_dest_prefix:
613
- return
614
- for path in ls_out_set:
615
- if (path == prev_dest_prefix + '/' or
616
- path == prev_dest_prefix + '.ready'):
617
- continue
618
- if path.endswith('.ready'):
619
- gsutil.call('rm', path)
620
- continue
621
- gsutil.call('-m', 'rm', '-r', path)
622
-
623
-
624
608
  @staticmethod
625
609
  def DeleteTmpPackFiles(path):
626
610
  pack_dir = os.path.join(path, 'objects', 'pack')
@@ -885,4 +869,4 @@ if __name__ == '__main__':
885
869
  sys.exit(main(sys.argv[1:]))
886
870
  except KeyboardInterrupt:
887
871
  sys.stderr.write('interrupted\n')
888
- sys.exit(1)
872
+ sys.exit(1)
@@ -79,29 +79,12 @@ GIT_HASH_RE = re.compile(r'\b([a-f0-9]{6})[a-f0-9]{34}\b', flags=re.I)
79
79
  # Used to redact the cookies from the gitcookies file.
80
80
  GITCOOKIES_REDACT_RE = re.compile(r'1/.*')
81
81
 
82
- # The maximum number of traces we will keep. Multiplied by 3 since we store
83
- # 3 files per trace.
84
- MAX_TRACES = 3 * 10
85
- # Message to be displayed to the user to inform where to find the traces for a
86
- # git-cl upload execution.
87
82
  TRACES_MESSAGE = (
88
- '\n'
89
- 'The traces of this git-cl execution have been recorded at:\n'
90
- ' %(trace_name)s-traces.zip\n'
91
- 'Copies of your gitcookies file and git config have been recorded at:\n'
92
- ' %(trace_name)s-git-info.zip\n')
93
- # Format of the message to be stored as part of the traces to give developers a
94
- # better context when they go through traces.
95
- TRACES_README_FORMAT = (
96
- 'Date: %(now)s\n'
97
- '\n'
98
- 'Change: https://%(gerrit_host)s/q/%(change_id)s\n'
99
- 'Title: %(title)s\n'
100
- '\n'
101
- '%(description)s\n'
102
- '\n'
103
- 'Execution time: %(execution_time)s\n'
104
- 'Exit code: %(exit_code)s\n') + TRACES_MESSAGE
83
+ 'When filing a bug, be sure to include the traces found at:\n'
84
+ ' %s.zip\n'
85
+ 'Consider including the git config and gitcookies,\n'
86
+ 'which we have packed for you at:\n'
87
+ ' %s.zip\n')
105
88
 
106
89
  COMMIT_BOT_EMAIL = 'commit-bot@chromium.org'
107
90
  POSTUPSTREAM_HOOK = '.git/hooks/post-cl-land'
@@ -222,12 +205,6 @@ def time_time():
222
205
  return time.time()
223
206
 
224
207
 
225
- def datetime_now():
226
- # Use this so that it can be mocked in tests without interfering with python
227
- # system machinery.
228
- return datetime.datetime.now()
229
-
230
-
231
208
  def ask_for_data(prompt):
232
209
  try:
233
210
  return raw_input(prompt)
@@ -2021,14 +1998,14 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
2021
1998
  if gerrit_auth == git_auth:
2022
1999
  return
2023
2000
  all_gsrc = cookie_auth.get_auth_header('d0esN0tEx1st.googlesource.com')
2024
- print(
2001
+ print((
2025
2002
  'WARNING: You have different credentials for Gerrit and git hosts:\n'
2026
2003
  ' %s\n'
2027
2004
  ' %s\n'
2028
2005
  ' Consider running the following command:\n'
2029
2006
  ' git cl creds-check\n'
2030
2007
  ' %s\n'
2031
- ' %s' %
2008
+ ' %s') %
2032
2009
  (git_host, self._gerrit_host,
2033
2010
  ('Hint: delete creds for .googlesource.com' if all_gsrc else ''),
2034
2011
  cookie_auth.get_new_password_message(git_host)))
@@ -2519,73 +2496,18 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
2519
2496
  else:
2520
2497
  print('OK, will keep Gerrit commit-msg hook in place.')
2521
2498
 
2522
- def _CleanUpOldTraces(self):
2523
- """Keep only the last |MAX_TRACES| traces."""
2524
- try:
2525
- traces = sorted([
2526
- os.path.join(TRACES_DIR, f)
2527
- for f in os.listdir(TRACES_DIR)
2528
- if (os.path.isfile(os.path.join(TRACES_DIR, f))
2529
- and not f.startswith('tmp'))
2530
- ])
2531
- traces_to_delete = traces[:-MAX_TRACES]
2532
- for trace in traces_to_delete:
2533
- os.remove(trace)
2534
- except OSError:
2535
- print('WARNING: Failed to remove old git traces from\n'
2536
- ' %s'
2537
- 'Consider removing them manually.' % TRACES_DIR)
2538
-
2539
- def _WriteGitPushTraces(self, trace_name, traces_dir, git_push_metadata):
2540
- """Zip and write the git push traces stored in traces_dir."""
2499
+ def _RunGitPushWithTraces(self, change_desc, refspec, refspec_opts):
2541
2500
  gclient_utils.safe_makedirs(TRACES_DIR)
2542
- traces_zip = trace_name + '-traces'
2543
- traces_readme = trace_name + '-README'
2544
- # Create a temporary dir to store git config and gitcookies in. It will be
2545
- # compressed and stored next to the traces.
2546
- git_info_dir = tempfile.mkdtemp()
2547
- git_info_zip = trace_name + '-git-info'
2548
-
2549
- git_push_metadata['now'] = datetime_now().strftime('%c')
2550
- git_push_metadata['trace_name'] = trace_name
2551
- gclient_utils.FileWrite(
2552
- traces_readme, TRACES_README_FORMAT % git_push_metadata)
2553
-
2554
- # Keep only the first 6 characters of the git hashes on the packet
2555
- # trace. This greatly decreases size after compression.
2556
- packet_traces = os.path.join(traces_dir, 'trace-packet')
2557
- if os.path.isfile(packet_traces):
2558
- contents = gclient_utils.FileRead(packet_traces)
2559
- gclient_utils.FileWrite(
2560
- packet_traces, GIT_HASH_RE.sub(r'\1', contents))
2561
- shutil.make_archive(traces_zip, 'zip', traces_dir)
2562
-
2563
- # Collect and compress the git config and gitcookies.
2564
- git_config = RunGit(['config', '-l'])
2565
- gclient_utils.FileWrite(
2566
- os.path.join(git_info_dir, 'git-config'),
2567
- git_config)
2568
-
2569
- cookie_auth = gerrit_util.Authenticator.get()
2570
- if isinstance(cookie_auth, gerrit_util.CookiesAuthenticator):
2571
- gitcookies_path = cookie_auth.get_gitcookies_path()
2572
- if os.path.isfile(gitcookies_path):
2573
- gitcookies = gclient_utils.FileRead(gitcookies_path)
2574
- gclient_utils.FileWrite(
2575
- os.path.join(git_info_dir, 'gitcookies'),
2576
- GITCOOKIES_REDACT_RE.sub('REDACTED', gitcookies))
2577
- shutil.make_archive(git_info_zip, 'zip', git_info_dir)
2578
-
2579
- gclient_utils.rmtree(git_info_dir)
2580
2501
 
2581
- def _RunGitPushWithTraces(
2582
- self, change_desc, refspec, refspec_opts, git_push_metadata):
2583
- """Run git push and collect the traces resulting from the execution."""
2584
2502
  # Create a temporary directory to store traces in. Traces will be compressed
2585
2503
  # and stored in a 'traces' dir inside depot_tools.
2586
2504
  traces_dir = tempfile.mkdtemp()
2587
- trace_name = os.path.join(
2588
- TRACES_DIR, datetime_now().strftime('%Y%m%dT%H%M%S.%f'))
2505
+ trace_name = os.path.basename(traces_dir)
2506
+ traces_zip = os.path.join(TRACES_DIR, trace_name + '-traces')
2507
+ # Create a temporary dir to store git config and gitcookies in. It will be
2508
+ # compressed and stored next to the traces.
2509
+ git_info_dir = tempfile.mkdtemp()
2510
+ git_info_zip = os.path.join(TRACES_DIR, trace_name + '-git-info')
2589
2511
 
2590
2512
  env = os.environ.copy()
2591
2513
  env['GIT_REDACT_COOKIES'] = 'o,SSO,GSSO_Uberproxy'
@@ -2596,10 +2518,9 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
2596
2518
 
2597
2519
  try:
2598
2520
  push_returncode = 0
2599
- remote_url = self.GetRemoteUrl()
2600
2521
  before_push = time_time()
2601
2522
  push_stdout = gclient_utils.CheckCallAndFilter(
2602
- ['git', 'push', remote_url, refspec],
2523
+ ['git', 'push', self.GetRemoteUrl(), refspec],
2603
2524
  env=env,
2604
2525
  print_stdout=True,
2605
2526
  # Flush after every line: useful for seeing progress when running as
@@ -2611,15 +2532,8 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
2611
2532
  'for the reason of the failure.\n'
2612
2533
  'Hint: run command below to diagnose common Git/Gerrit '
2613
2534
  'credential problems:\n'
2614
- ' git cl creds-check\n'
2615
- '\n'
2616
- 'If git-cl is not working correctly, file a bug under the '
2617
- 'Infra>SDK component including the files below.\n'
2618
- 'Review the files before upload, since they might contain '
2619
- 'sensitive information.\n'
2620
- 'Set the Restrict-View-Google label so that they are not '
2621
- 'publicly accessible.\n'
2622
- + TRACES_MESSAGE % {'trace_name': trace_name},
2535
+ ' git cl creds-check\n' +
2536
+ TRACES_MESSAGE % (traces_zip, git_info_zip),
2623
2537
  change_desc)
2624
2538
  finally:
2625
2539
  execution_time = time_time() - before_push
@@ -2630,11 +2544,31 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
2630
2544
  'arguments': metrics_utils.extract_known_subcommand_args(refspec_opts),
2631
2545
  })
2632
2546
 
2633
- git_push_metadata['execution_time'] = execution_time
2634
- git_push_metadata['exit_code'] = push_returncode
2635
- self._WriteGitPushTraces(trace_name, traces_dir, git_push_metadata)
2547
+ if push_returncode != 0:
2548
+ # Keep only the first 6 characters of the git hashes on the packet
2549
+ # trace. This greatly decreases size after compression.
2550
+ packet_traces = os.path.join(traces_dir, 'trace-packet')
2551
+ contents = gclient_utils.FileRead(packet_traces)
2552
+ gclient_utils.FileWrite(
2553
+ packet_traces, GIT_HASH_RE.sub(r'\1', contents))
2554
+ shutil.make_archive(traces_zip, 'zip', traces_dir)
2636
2555
 
2637
- self._CleanUpOldTraces()
2556
+ # Collect and compress the git config and gitcookies.
2557
+ git_config = RunGit(['config', '-l'])
2558
+ gclient_utils.FileWrite(
2559
+ os.path.join(git_info_dir, 'git-config'),
2560
+ git_config)
2561
+
2562
+ cookie_auth = gerrit_util.Authenticator.get()
2563
+ if isinstance(cookie_auth, gerrit_util.CookiesAuthenticator):
2564
+ gitcookies_path = cookie_auth.get_gitcookies_path()
2565
+ gitcookies = gclient_utils.FileRead(gitcookies_path)
2566
+ gclient_utils.FileWrite(
2567
+ os.path.join(git_info_dir, 'gitcookies'),
2568
+ GITCOOKIES_REDACT_RE.sub('REDACTED', gitcookies))
2569
+ shutil.make_archive(git_info_zip, 'zip', git_info_dir)
2570
+
2571
+ gclient_utils.rmtree(git_info_dir)
2638
2572
  gclient_utils.rmtree(traces_dir)
2639
2573
 
2640
2574
  return push_stdout
@@ -2888,14 +2822,7 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
2888
2822
  'spaces not allowed in refspec: "%s"' % refspec_suffix)
2889
2823
  refspec = '%s:refs/for/%s%s' % (ref_to_push, branch, refspec_suffix)
2890
2824
 
2891
- git_push_metadata = {
2892
- 'gerrit_host': self._GetGerritHost(),
2893
- 'title': title or '<untitled>',
2894
- 'change_id': change_id,
2895
- 'description': change_desc.description,
2896
- }
2897
- push_stdout = self._RunGitPushWithTraces(
2898
- change_desc, refspec, refspec_opts, git_push_metadata)
2825
+ push_stdout = self._RunGitPushWithTraces(change_desc, refspec, refspec_opts)
2899
2826
 
2900
2827
  if options.squash:
2901
2828
  regex = re.compile(r'remote:\s+https?://[\w\-\.\+\/#]*/(\d+)\s.*')
@@ -4,8 +4,6 @@
4
4
  # found in the LICENSE file.
5
5
  """git drover: A tool for merging changes to release branches."""
6
6
 
7
- from __future__ import print_function
8
-
9
7
  import argparse
10
8
  import cPickle
11
9
  import functools
@@ -454,7 +452,7 @@ def main():
454
452
  options.parent_checkout, options.dry_run,
455
453
  options.verbose)
456
454
  except Error as e:
457
- print('Error:', e.message)
455
+ print 'Error:', e.message
458
456
  sys.exit(128)
459
457
 
460
458
 
@@ -11,8 +11,6 @@ Note that it uses the "cherry picked from" annotation to find merges, so it will
11
11
  only work on merges that followed the "use cherry-pick -x" instructions.
12
12
  """
13
13
 
14
- from __future__ import print_function
15
-
16
14
  import optparse
17
15
  import re
18
16
  import sys
@@ -45,16 +43,16 @@ def main():
45
43
  for arg in args:
46
44
  commit_name = GetNameForCommit(arg)
47
45
  if not commit_name:
48
- print('%s not found' % arg)
46
+ print '%s not found' % arg
49
47
  return 1
50
- print('commit %s was:' % arg)
51
- print(' initially in ' + commit_name)
48
+ print 'commit %s was:' % arg
49
+ print ' initially in ' + commit_name
52
50
  merges = GetMergesForCommit(arg)
53
51
  for merge in merges:
54
- print(' merged to ' + GetNameForCommit(merge) + ' (as ' + merge + ')')
52
+ print ' merged to ' + GetNameForCommit(merge) + ' (as ' + merge + ')'
55
53
  if not merges:
56
- print('No merges found. If this seems wrong, be sure that you did:')
57
- print(' git fetch origin && gclient sync --with_branch_heads')
54
+ print 'No merges found. If this seems wrong, be sure that you did:'
55
+ print ' git fetch origin && gclient sync --with_branch_heads'
58
56
 
59
57
  return 0
60
58
 
@@ -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 json
10
8
  import re
@@ -231,23 +229,23 @@ def main(args):
231
229
 
232
230
  if opts.key:
233
231
  for v in footers.get(normalize_name(opts.key), []):
234
- print(v)
232
+ print v
235
233
  elif opts.position:
236
234
  pos = get_position(footers)
237
- print('%s@{#%s}' % (pos[0], pos[1] or '?'))
235
+ print '%s@{#%s}' % (pos[0], pos[1] or '?')
238
236
  elif opts.position_ref:
239
- print(get_position(footers)[0])
237
+ print get_position(footers)[0]
240
238
  elif opts.position_num:
241
239
  pos = get_position(footers)
242
240
  assert pos[1], 'No valid position for commit'
243
- print(pos[1])
241
+ print pos[1]
244
242
  elif opts.json:
245
243
  with open(opts.json, 'w') as f:
246
244
  json.dump(footers, f)
247
245
  else:
248
246
  for k in footers.keys():
249
247
  for v in footers[k]:
250
- print('%s: %s' % (k, v))
248
+ print '%s: %s' % (k, v)
251
249
  return 0
252
250
 
253
251
 
@@ -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 sys
9
7
  import optparse
10
8
 
@@ -28,7 +26,7 @@ def main(args):
28
26
  dispatcher = subcommand.CommandDispatcher(__name__)
29
27
  ret = dispatcher.execute(optparse.OptionParser(), args)
30
28
  if ret:
31
- print(ret)
29
+ print ret
32
30
  return 0
33
31
 
34
32