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

Unified Diff: git_cl.py

Issue 298703003: Upload project option (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 7 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 | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index fe9fec76035fc1385de200928a440f125e9f074c..c8c83309f4c47ac8decd1e698c67a1cf125d29b6 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -281,6 +281,7 @@ class Settings(object):
self.updated = False
self.is_gerrit = None
self.git_editor = None
+ self.project = None
def LazyUpdateIfNeeded(self):
"""Updates the settings from a codereview.settings file, if available."""
@@ -442,6 +443,11 @@ class Settings(object):
return (self._GetRietveldConfig('cpplint-ignore-regex', error_ok=True) or
DEFAULT_LINT_IGNORE_REGEX)
+ def GetProject(self):
+ if not self.project:
+ self.project = self._GetRietveldConfig('project', error_ok=True)
+ return self.project
+
def _GetRietveldConfig(self, param, **kwargs):
return self._GetConfig('rietveld.' + param, **kwargs)
@@ -1067,6 +1073,7 @@ def LoadCodereviewSettingsFromFile(fileobj):
SetProperty('bug-prefix', 'BUG_PREFIX', unset_error_ok=True)
SetProperty('cpplint-regex', 'LINT_REGEX', unset_error_ok=True)
SetProperty('cpplint-ignore-regex', 'LINT_IGNORE_REGEX', unset_error_ok=True)
+ SetProperty('project', 'PROJECT', unset_error_ok=True)
if 'GERRIT_HOST' in keyvals:
RunGit(['config', 'gerrit.host', keyvals['GERRIT_HOST']])
@@ -1619,6 +1626,10 @@ def RietveldUpload(options, args, cl):
if remote_url:
upload_args.extend(['--base_url', remote_url])
+ project = settings.GetProject()
+ if project:
+ upload_args.extend(['--project', project])
+
try:
upload_args = ['upload'] + upload_args + args
logging.info('upload.RealMain(%s)', upload_args)
« no previous file with comments | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698