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

Unified Diff: git_cl.py

Issue 2109253002: Allow git_cl to be called when no default server is given (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 6 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 | tests/git_cl_test.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 6f25e4aa4a47ae1fc3c4d7062971cd2878ba32ad..35ca50a1aba868e21bb94a1036ba3b6a0429bf55 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1595,7 +1595,8 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
def __init__(self, changelist, auth_config=None, rietveld_server=None):
super(_RietveldChangelistImpl, self).__init__(changelist)
assert settings, 'must be initialized in _ChangelistCodereviewBase'
- settings.GetDefaultServerUrl()
+ if not rietveld_server:
+ settings.GetDefaultServerUrl()
self._rietveld_server = rietveld_server
self._auth_config = auth_config
@@ -3479,17 +3480,23 @@ def CMDdescription(parser, args):
target_issue = None
if len(args) > 0:
- issue_arg = ParseIssueNumberArgument(args[0])
- if not issue_arg.valid:
+ target_issue = ParseIssueNumberArgument(args[0])
+ if not target_issue.valid:
parser.print_help()
return 1
- target_issue = issue_arg.issue
auth_config = auth.extract_auth_config_from_options(options)
- cl = Changelist(
- auth_config=auth_config, issue=target_issue,
- codereview=options.forced_codereview)
+ kwargs = {
+ 'auth_config': auth_config,
+ 'codereview': options.forced_codereview,
+ }
+ if target_issue:
+ kwargs['issue'] = target_issue.issue
+ if options.forced_codereview == 'rietveld':
+ kwargs['rietveld_server'] = target_issue.hostname
+
+ cl = Changelist(**kwargs)
if not cl.GetIssue():
DieWithError('This branch has no associated changelist.')
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698