From e72279d25f75444f1ea053ab2e5c13f1cedbeeaf Mon Sep 17 00:00:00 2001 From: Henrique Ferreiro Date: Wed, 17 Apr 2019 12:01:50 +0000 Subject: [PATCH] Keep warning about unversioned trees until removed Restore previous behavior and keep emitting a warning when an existing gclient entry is not longer part of the client. Additionally, suggest the usage of `gclient sync -D` to automatically remove them. Change-Id: I62d4662ae4d0886d340230019419b68debffc5ba Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1483031 Reviewed-by: Dirk Pranke Reviewed-by: Michael Moss Commit-Queue: Henrique Ferreiro --- gclient.py | 20 +++++++++++++++++--- gclient_scm.py | 3 ++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gclient.py b/gclient.py index a60d33134..2c497f712 100755 --- a/gclient.py +++ b/gclient.py @@ -1675,9 +1675,23 @@ it or fix the checkout. (modified_files and not self._options.force)): # There are modified files in this entry. Keep warning until # removed. - print(('\nWARNING: \'%s\' is no longer part of this client. ' - 'It is recommended that you manually remove it.\n') % - entry_fixed) + self.add_dependency( + GitDependency( + parent=self, + name=entry, + url=prev_url, + managed=False, + custom_deps={}, + custom_vars={}, + custom_hooks=[], + deps_file=None, + should_process=True, + should_recurse=False, + relative=None, + condition=None)) + print(('\nWARNING: \'%s\' is no longer part of this client.\n' + 'It is recommended that you manually remove it or use ' + '\'gclient sync -D\' next time.') % entry_fixed) else: # Delete the entry print('\n________ deleting \'%s\' in \'%s\'' % ( diff --git a/gclient_scm.py b/gclient_scm.py index e102e8073..c9c26bd75 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -222,7 +222,8 @@ class GitWrapper(SCMWrapper): def __init__(self, url=None, *args, **kwargs): """Removes 'git+' fake prefix from git URL.""" - if url.startswith('git+http://') or url.startswith('git+https://'): + if url and (url.startswith('git+http://') or + url.startswith('git+https://')): url = url[4:] SCMWrapper.__init__(self, url, *args, **kwargs) filter_kwargs = { 'time_throttle': 1, 'out_fh': self.out_fh }