From 47fd56744c211f8cceaa1874bbc2b3ebe9d3c652 Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Fri, 5 Aug 2022 20:53:31 +0000 Subject: [PATCH] Add debug logs during Clone process. The try/except was added for one specific situation but the 'except' portion accepts a wide range of errors. This results in confusing logs and nothing clearly states what actually caused the error. Bug: 1349905, 1350210 Change-Id: Ia86c71b0b77658992fca5d3de215e659ccd90d96 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3810798 Commit-Queue: Joanna Wang Reviewed-by: Gavin Mak --- gclient_scm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gclient_scm.py b/gclient_scm.py index 8b8ee5f57d..e7edc00b68 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -644,7 +644,8 @@ class GitWrapper(SCMWrapper): self._UpdateMirrorIfNotContains(mirror, options, rev_type, revision) try: self._Clone(revision, url, options) - except subprocess2.CalledProcessError: + except subprocess2.CalledProcessError as e: + logging.warning('Clone failed due to: %s', e) self._DeleteOrMove(options.force) self._Clone(revision, url, options) if file_list is not None: @@ -1173,6 +1174,7 @@ class GitWrapper(SCMWrapper): retry=True, print_stdout=print_stdout, filter_fn=filter_fn) + logging.debug('Cloned into temporary dir, moving to checkout_path') gclient_utils.safe_makedirs(self.checkout_path) gclient_utils.safe_rename(os.path.join(tmp_dir, '.git'), os.path.join(self.checkout_path, '.git'))