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):
# already initialized.
global CODEREVIEW_SETTINGS
if '__just_initialized' not in CODEREVIEW_SETTINGS:
for line in GetCachedFile(CODEREVIEW_SETTINGS_FILE).splitlines():
if not line or line.startswith("#"):
continue
k, v = line.split(": ", 1)
CODEREVIEW_SETTINGS[k] = v
settings_file = GetCachedFile(CODEREVIEW_SETTINGS_FILE)
if settings_file:
for line in settings_file.splitlines():
if not line or line.startswith("#"):
continue
k, v = line.split(": ", 1)
CODEREVIEW_SETTINGS[k] = v
CODEREVIEW_SETTINGS.setdefault('__just_initialized', None)
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