depot_tools.patch 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Changes to gclient that:
  2. # move dotfiles into the staging directory
  3. # skip cipd binary downloads
  4. # replace 'src' in checkout paths with the output directory
  5. # ensure shallow fetches
  6. --- a/gclient.py
  7. +++ b/gclient.py
  8. @@ -126,8 +126,8 @@ DEPOT_TOOLS_DIR = os.path.dirname(os.pat
  9. # one, e.g. if a spec explicitly says `cache_dir = None`.)
  10. UNSET_CACHE_DIR = object()
  11. -PREVIOUS_CUSTOM_VARS_FILE = '.gclient_previous_custom_vars'
  12. -PREVIOUS_SYNC_COMMITS_FILE = '.gclient_previous_sync_commits'
  13. +PREVIOUS_CUSTOM_VARS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_custom_vars'
  14. +PREVIOUS_SYNC_COMMITS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_sync_commits'
  15. PREVIOUS_SYNC_COMMITS = 'GCLIENT_PREVIOUS_SYNC_COMMITS'
  16. @@ -422,6 +422,7 @@ class Dependency(gclient_utils.WorkItem,
  17. protocol='https',
  18. git_dependencies_state=gclient_eval.DEPS,
  19. print_outbuf=False):
  20. + if name and name[0:3] == "src": name = r"UC_OUT"+name[3:]
  21. gclient_utils.WorkItem.__init__(self, name)
  22. DependencySettings.__init__(self, parent, url, managed, custom_deps,
  23. custom_vars, custom_hooks, deps_file,
  24. @@ -730,6 +731,7 @@ class Dependency(gclient_utils.WorkItem,
  25. condition = dep_value.get('condition')
  26. dep_type = dep_value.get('dep_type')
  27. + if dep_type == 'cipd': continue
  28. if condition and not self._get_option('process_all_deps', False):
  29. if condition not in cached_conditions:
  30. @@ -846,6 +848,8 @@ class Dependency(gclient_utils.WorkItem,
  31. self._gn_args_from = local_scope.get('gclient_gn_args_from')
  32. self._gn_args_file = local_scope.get('gclient_gn_args_file')
  33. + if self._gn_args_file and self._gn_args_file[0:3] == "src":
  34. + self._gn_args_file = r"UC_OUT"+self._gn_args_file[3:]
  35. self._gn_args = local_scope.get('gclient_gn_args', [])
  36. # It doesn't make sense to set all of these, since setting gn_args_from
  37. # to another DEPS will make gclient ignore any other local gn_args*
  38. --- a/gclient_scm.py
  39. +++ b/gclient_scm.py
  40. @@ -844,8 +844,7 @@ class GitWrapper(SCMWrapper):
  41. self._SetFetchConfig(options)
  42. # Fetch upstream if we don't already have |revision|.
  43. - if not scm.GIT.IsValidRevision(
  44. - self.checkout_path, revision, sha_only=True):
  45. + if False:
  46. self._Fetch(options, prune=options.force)
  47. if not scm.GIT.IsValidRevision(
  48. @@ -861,7 +860,7 @@ class GitWrapper(SCMWrapper):
  49. # This is a big hammer, debatable if it should even be here...
  50. if options.force or options.reset:
  51. - target = 'HEAD'
  52. + target = 'FETCH_HEAD'
  53. if options.upstream and upstream_branch:
  54. target = upstream_branch
  55. self._Scrub(target, options)
  56. @@ -876,7 +875,6 @@ class GitWrapper(SCMWrapper):
  57. # to the checkout step.
  58. if not (options.force or options.reset):
  59. self._CheckClean(revision)
  60. - self._CheckDetachedHead(revision, options)
  61. if self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision:
  62. self.Print('Up-to-date; skipping checkout.')
  63. else:
  64. @@ -1550,8 +1548,7 @@ class GitWrapper(SCMWrapper):
  65. fetch_cmd.append('--no-tags')
  66. elif quiet:
  67. fetch_cmd.append('--quiet')
  68. - if depth:
  69. - fetch_cmd.append('--depth=' + str(depth))
  70. + fetch_cmd.append('--depth=1')
  71. self._Run(fetch_cmd, options, show_header=options.verbose, retry=True)
  72. def _SetFetchConfig(self, options):