bisect-kit: reduce warnings
"WARNING dep_type=cipd is not supported yet" is flooding and annoying.
Special handling to make it appear only once.
BUG=chromium:846564
TEST=unittest
Change-Id: Ibdeac16614f5e3b54ea63788bf51465114d5885d
Reviewed-on: https://chromium-review.googlesource.com/1445913
Commit-Ready: Kuang-che Wu <kcwu@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
diff --git a/bisect_kit/gclient_util.py b/bisect_kit/gclient_util.py
index ea6b5d8..41925de 100644
--- a/bisect_kit/gclient_util.py
+++ b/bisect_kit/gclient_util.py
@@ -21,6 +21,7 @@
from bisect_kit import util
logger = logging.getLogger(__name__)
+emitted_warnings = set()
def config(gclient_dir,
@@ -474,8 +475,11 @@
# TODO(kcwu): support dep_type=cipd http://crbug.com/846564
if dep.dep_type != 'git':
- logger.warning('dep_type=%s is not supported yet: %s', dep.dep_type,
- path)
+ warning_key = ('dep_type', dep.dep_type, path)
+ if warning_key not in emitted_warnings:
+ emitted_warnings.add(warning_key)
+ logger.warning('dep_type=%s is not supported yet: %s', dep.dep_type,
+ path)
continue
deps.entries[path] = dep