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

Unified Diff: git_cl.py

Issue 967453004: Stop defaulting unrecognized branches to master except for handful of special refs (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Create an alias map Created 5 years, 10 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 bcd4a6252b018978cc860b3ebebf75dd6f197d54..41ed20c3534f15f1d4f54a7c1ba285b9fedf27fb 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -56,6 +56,10 @@ POSTUPSTREAM_HOOK_PATTERN = '.git/hooks/post-cl-%s'
DESCRIPTION_BACKUP_FILE = '~/.git_cl_description_backup'
GIT_INSTRUCTIONS_URL = 'http://code.google.com/p/chromium/wiki/UsingGit'
CHANGE_ID = 'Change-Id:'
+REFS_THAT_ALIAS_TO_OTHER_REFS = {
+ 'refs/remotes/origin/lkgr': 'refs/remotes/origin/master',
+ 'refs/remotes/origin/lkcr': 'refs/remotes/origin/master',
+}
# Valid extensions for files we want to lint.
DEFAULT_LINT_REGEX = r"(.*\.cpp|.*\.cc|.*\.h)"
@@ -1790,10 +1794,9 @@ def GetTargetRef(remote, remote_branch, target_branch, pending_prefix):
if not match:
# This is a branch path but not one we recognize; use as-is.
remote_branch = target_branch
- elif (not remote_branch.startswith('refs/remotes/branch-heads') and
- not remote_branch.startswith('refs/remotes/%s/refs' % remote)):
- # Default to master for refs that are not branches.
- remote_branch = 'refs/remotes/%s/master' % remote
+ elif remote_branch in REFS_THAT_ALIAS_TO_OTHER_REFS:
+ # Handle the refs that need to land in different refs.
+ remote_branch = REFS_THAT_ALIAS_TO_OTHER_REFS[remote_branch]
# Create the true path to the remote branch.
# Does the following translation:
« 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