Commit b044218c authored by maruel@chromium.org's avatar maruel@chromium.org

Fix gcl in the case there is no CODEREVIEW_SETTINGS file in the repository.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/118265

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17727 0039d316-1c4b-4281-b951-d872f2087c98
parent 85532fc2
...@@ -178,11 +178,13 @@ def GetCodeReviewSetting(key): ...@@ -178,11 +178,13 @@ def GetCodeReviewSetting(key):
# already initialized. # already initialized.
global CODEREVIEW_SETTINGS global CODEREVIEW_SETTINGS
if '__just_initialized' not in CODEREVIEW_SETTINGS: if '__just_initialized' not in CODEREVIEW_SETTINGS:
for line in GetCachedFile(CODEREVIEW_SETTINGS_FILE).splitlines(): settings_file = GetCachedFile(CODEREVIEW_SETTINGS_FILE)
if not line or line.startswith("#"): if settings_file:
continue for line in settings_file.splitlines():
k, v = line.split(": ", 1) if not line or line.startswith("#"):
CODEREVIEW_SETTINGS[k] = v continue
k, v = line.split(": ", 1)
CODEREVIEW_SETTINGS[k] = v
CODEREVIEW_SETTINGS.setdefault('__just_initialized', None) CODEREVIEW_SETTINGS.setdefault('__just_initialized', None)
return CODEREVIEW_SETTINGS.get(key, "") return CODEREVIEW_SETTINGS.get(key, "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment