mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Revert "Allow patching multiple directories if shared URL"
This reverts commit 8559499c4c.
Reason for revert: breaks internal presubmits
https://crbug.com/1457050
Original change's description:
> Allow patching multiple directories if shared URL
>
> If there are more than one DEPS entry that can be patched (e.g. two DEPS
> entries with the same URL, but different path, ie. src-internal and
> src/internal), then gclient should patch all of them and not just the
> first one it seees.
>
> R=gavinmak@google.com
>
> Change-Id: I617b1771062a718421d8ed17941bc3eef3288005
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4630529
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Gavin Mak <gavinmak@google.com>
Bug: 1457050
Change-Id: I76fd217917a569bc3cc7220c2d2090675996dcdc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4635526
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This commit is contained in:
27
gclient.py
27
gclient.py
@@ -985,7 +985,6 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
|
||||
patch_refs, # type: Mapping[str, str]
|
||||
target_branches, # type: Mapping[str, str]
|
||||
skip_sync_revisions, # type: Mapping[str, str]
|
||||
applied_patches=None, # type: Set[str]
|
||||
):
|
||||
# type: () -> None
|
||||
"""Runs |command| then parse the DEPS file."""
|
||||
@@ -1029,11 +1028,9 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
|
||||
|
||||
if isinstance(self, GitDependency) and command == 'update':
|
||||
patch_repo = self.url.split('@')[0]
|
||||
fuzzy_match = self.FuzzyMatchUrl(patch_refs)
|
||||
patch_ref = patch_refs[fuzzy_match] if fuzzy_match else None
|
||||
target_branch = target_branches[fuzzy_match] if fuzzy_match else None
|
||||
if fuzzy_match and applied_patches is not None:
|
||||
applied_patches.add(fuzzy_match)
|
||||
patch_ref = patch_refs.pop(self.FuzzyMatchUrl(patch_refs), None)
|
||||
target_branch = target_branches.pop(
|
||||
self.FuzzyMatchUrl(target_branches), None)
|
||||
if patch_ref:
|
||||
latest_commit = self._used_scm.apply_patch_ref(
|
||||
patch_repo, patch_ref, target_branch, options, file_list)
|
||||
@@ -2003,7 +2000,6 @@ it or fix the checkout.
|
||||
patch_refs = {}
|
||||
target_branches = {}
|
||||
skip_sync_revisions = {}
|
||||
applied_patches = set()
|
||||
# It's unnecessary to check for revision overrides for 'recurse'.
|
||||
# Save a few seconds by not calling _EnforceRevisions() in that case.
|
||||
if command not in ('diff', 'recurse', 'runhooks', 'status', 'revert',
|
||||
@@ -2048,14 +2044,13 @@ it or fix the checkout.
|
||||
options=self._options,
|
||||
patch_refs=patch_refs,
|
||||
target_branches=target_branches,
|
||||
skip_sync_revisions=skip_sync_revisions,
|
||||
applied_patches=applied_patches)
|
||||
skip_sync_revisions=skip_sync_revisions)
|
||||
|
||||
if revision_overrides:
|
||||
print('Please fix your script, having invalid --revision flags will soon '
|
||||
'be considered an error.', file=sys.stderr)
|
||||
|
||||
if patch_refs.keys() != applied_patches:
|
||||
if patch_refs:
|
||||
raise gclient_utils.Error(
|
||||
'The following --patch-ref flags were not used. Please fix it:\n%s' %
|
||||
('\n'.join(
|
||||
@@ -2253,16 +2248,8 @@ class CipdDependency(Dependency):
|
||||
self._package_version = version
|
||||
|
||||
#override
|
||||
def run(self,
|
||||
revision_overrides,
|
||||
command,
|
||||
args,
|
||||
work_queue,
|
||||
options,
|
||||
patch_refs,
|
||||
target_branches,
|
||||
skip_sync_revisions,
|
||||
applied_patches=None):
|
||||
def run(self, revision_overrides, command, args, work_queue, options,
|
||||
patch_refs, target_branches, skip_sync_revisions):
|
||||
"""Runs |command| then parse the DEPS file."""
|
||||
logging.info('CipdDependency(%s).run()' % self.name)
|
||||
if not self.should_process:
|
||||
|
||||
Reference in New Issue
Block a user