From ffb4b890997b1799f188ec44f005d949feb643a7 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 4 Apr 2017 22:03:53 -0700 Subject: [PATCH] sync.py: report the remote URL on fatal git remote errors repo can be configured to download from any number of remote git repos. However when one fails repo doesn't report which one. Example: Fatal: remote error: Daily ls-remote rate limit exceeded for IP xx.xx.xx.xx TEST=repo init -q -u https://chromium.googlesource.com/chromiumos/manifest.git # Apply patch in ./.repo/repo/ # Simulate a git remote error: sed -i -e 's#chromiumos/docs#chromiumos/XXdocs#' .repo/manifests/full.xml repo sync --quiet --force-sync docs # error message now shows the remote URL Optional test tip: reduce the time.sleep(random(...)) in ./.repo/repo/project.py Change-Id: I4509383b6a43a8e66064778e8ed612d8a735c8b6 --- subcmds/sync.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index bbb166c0..8e8529ee 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -324,7 +324,9 @@ later is required to fix a server side protocol bug. if not success: err_event.set() - print('error: Cannot fetch %s' % project.name, file=sys.stderr) + print('error: Cannot fetch %s from %s' + % (project.name, project.remote.url), + file=sys.stderr) if opt.force_broken: print('warn: --force-broken, continuing to sync', file=sys.stderr)