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

Unified Diff: git_cl.py

Issue 1149653002: [depot_tools] Find, upload and apply patchset dependencies (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Also catch ValueError Created 5 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 | « apply_issue.py ('k') | rietveld.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 f7192541f8769d793df98a84dbf2b10c288964ac..288e281b1170aa16220eb5fe6527f638dc1d6b5d 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2185,6 +2185,28 @@ def RietveldUpload(options, args, cl, change):
if target_ref:
upload_args.extend(['--target_ref', target_ref])
+ # Look for dependent patchsets. See crbug.com/480453 for more details.
+ remote, upstream_branch = cl.FetchUpstreamTuple(cl.GetBranch())
+ upstream_branch = ShortBranchName(upstream_branch)
+ if remote is '.':
+ # A local branch is being tracked.
+ local_branch = ShortBranchName(upstream_branch)
+ auth_config = auth.extract_auth_config_from_options(options)
+ branch_cl = Changelist(branchref=local_branch, auth_config=auth_config)
+ branch_cl_issue_url = branch_cl.GetIssueURL()
+ branch_cl_issue = branch_cl.GetIssue()
+ branch_cl_patchset = branch_cl.GetPatchset()
+ if branch_cl_issue_url and branch_cl_issue and branch_cl_patchset:
+ upload_args.extend(
+ ['--depends_on_patchset', '%s:%s' % (
+ branch_cl_issue, branch_cl_patchset)])
+ print
+ print ('The current branch (%s) is tracking a local branch (%s) with '
+ 'an open CL.') % (cl.GetBranch(), local_branch)
+ print 'Adding %s/#ps%s as a dependency patchset.' % (
+ branch_cl_issue_url, branch_cl_patchset)
+ print
+
project = settings.GetProject()
if project:
upload_args.extend(['--project', project])
« no previous file with comments | « apply_issue.py ('k') | rietveld.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698