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

Unified Diff: git_cl.py

Issue 781523002: depot_tools: Send the remote tracked ref to Rietveld via upload.py (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: remote_ref -> target_ref Created 6 years 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 | third_party/upload.py » ('j') | third_party/upload.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
===================================================================
--- git_cl.py (revision 293289)
+++ git_cl.py (working copy)
@@ -1747,6 +1747,21 @@
+ cl.GetUpstreamBranch().split('/')[-1])
if remote_url:
upload_args.extend(['--base_url', remote_url])
+ remote, remote_branch = cl.GetRemoteBranch()
+ if remote and remote_branch:
+ # Create the true path to the remote branch.
+ # Does the following translation:
+ # * refs/remotes/origin/refs/diff/test -> refs/diff/test
+ # * refs/remotes/origin/master -> refs/heads/master
+ # * refs/remotes/branch-heads/test -> refs/branch-heads/test
+ if remote_branch.startswith('refs/remotes/%s/refs/' % remote):
+ remote_branch = remote_branch.replace('refs/remotes/%s/' % remote, '')
+ elif remote_branch.startswith('refs/remotes/%s/' % remote):
+ remote_branch = remote_branch.replace('refs/remotes/%s/' % remote,
+ 'refs/heads/')
+ elif remote_branch.startswith('refs/remotes/branch-heads'):
+ remote_branch = remote_branch.replace('refs/remotes/', 'refs/')
+ upload_args.extend(['--target_ref', remote_branch])
agable 2014/12/09 20:42:56 So what happens if either remote or remote_branch
rmistry 2014/12/09 20:54:43 Those are good questions and I am not sure. Lookin
project = settings.GetProject()
if project:
« no previous file with comments | « no previous file | third_party/upload.py » ('j') | third_party/upload.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698