|
|
|
|
@ -760,7 +760,6 @@ class Settings(object):
|
|
|
|
|
self.project = None
|
|
|
|
|
self.force_https_commit_url = None
|
|
|
|
|
self.pending_ref_prefix = None
|
|
|
|
|
self.git_number_footer = None
|
|
|
|
|
|
|
|
|
|
def LazyUpdateIfNeeded(self):
|
|
|
|
|
"""Updates the settings from a codereview.settings file, if available."""
|
|
|
|
|
@ -996,14 +995,6 @@ class Settings(object):
|
|
|
|
|
'pending-ref-prefix', error_ok=True)
|
|
|
|
|
return self.pending_ref_prefix
|
|
|
|
|
|
|
|
|
|
def GetHasGitNumberFooter(self):
|
|
|
|
|
# TODO(tandrii): this has to be removed after Rietveld is read-only.
|
|
|
|
|
# see also bugs http://crbug.com/642493 and http://crbug.com/600469.
|
|
|
|
|
if not self.git_number_footer:
|
|
|
|
|
self.git_number_footer = self._GetRietveldConfig(
|
|
|
|
|
'git-number-footer', error_ok=True)
|
|
|
|
|
return self.git_number_footer
|
|
|
|
|
|
|
|
|
|
def _GetRietveldConfig(self, param, **kwargs):
|
|
|
|
|
return self._GetConfig('rietveld.' + param, **kwargs)
|
|
|
|
|
|
|
|
|
|
@ -1015,6 +1006,19 @@ class Settings(object):
|
|
|
|
|
return RunGit(['config', param], **kwargs).strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def ShouldGenerateGitNumberFooters():
|
|
|
|
|
"""Decides depending on codereview.settings file in the current checkout HEAD.
|
|
|
|
|
"""
|
|
|
|
|
# TODO(tandrii): this has to be removed after Rietveld is read-only.
|
|
|
|
|
# see also bugs http://crbug.com/642493 and http://crbug.com/600469.
|
|
|
|
|
cr_settings_file = FindCodereviewSettingsFile()
|
|
|
|
|
if not cr_settings_file:
|
|
|
|
|
return False
|
|
|
|
|
keyvals = gclient_utils.ParseCodereviewSettingsContent(
|
|
|
|
|
cr_settings_file.read())
|
|
|
|
|
return keyvals.get('generate-git-number-footers', '').lower() == 'true'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def ShortBranchName(branch):
|
|
|
|
|
"""Convert a name like 'refs/heads/foo' to just 'foo'."""
|
|
|
|
|
return branch.replace('refs/heads/', '', 1)
|
|
|
|
|
@ -3210,7 +3214,6 @@ def LoadCodereviewSettingsFromFile(fileobj):
|
|
|
|
|
SetProperty('cpplint-ignore-regex', 'LINT_IGNORE_REGEX', unset_error_ok=True)
|
|
|
|
|
SetProperty('project', 'PROJECT', unset_error_ok=True)
|
|
|
|
|
SetProperty('pending-ref-prefix', 'PENDING_REF_PREFIX', unset_error_ok=True)
|
|
|
|
|
SetProperty('git-number-footer', 'GIT_NUMBER_FOOTER', unset_error_ok=True)
|
|
|
|
|
SetProperty('run-post-upload-hook', 'RUN_POST_UPLOAD_HOOK',
|
|
|
|
|
unset_error_ok=True)
|
|
|
|
|
|
|
|
|
|
|