Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Unified Diff: gcl.py

Issue 9214002: Dedupe codereview.settings parsing code. Add more testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gclient_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index 77b3ae9725b52fdc070469b025715788e9e4cee0..10942f0a78c5e5a98b2b8511410b226b034dd26a 100755
--- a/gcl.py
+++ b/gcl.py
@@ -208,15 +208,8 @@ def GetCodeReviewSetting(key):
if '__just_initialized' not in CODEREVIEW_SETTINGS:
settings_file = GetCachedFile(CODEREVIEW_SETTINGS_FILE)
if settings_file:
- for line in settings_file.splitlines():
- if not line or line.startswith('#'):
- continue
- if not ':' in line:
- raise gclient_utils.Error(
- '%s is invalid, please fix. It\'s content:\n\n%s' %
- (CODEREVIEW_SETTINGS_FILE, settings_file))
- k, v = line.split(':', 1)
- CODEREVIEW_SETTINGS[k.strip()] = v.strip()
+ CODEREVIEW_SETTINGS.update(
+ gclient_utils.ParseCodereviewSettingsContent(settings_file))
CODEREVIEW_SETTINGS.setdefault('__just_initialized', None)
return CODEREVIEW_SETTINGS.get(key, "")
« no previous file with comments | « no previous file | gclient_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698