summaryrefslogtreecommitdiffstats
path: root/tools/sync-webkit-git.py
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-29 18:30:15 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-29 18:30:15 +0000
commit9641e22aa3ab02a7ed362f9301c20fe8924aa842 (patch)
tree16211fa1dba37b3f958d827f5a83a093c73d25c6 /tools/sync-webkit-git.py
parentbb23d41f81478e5d6b532dca3676d5415f79a5a7 (diff)
downloadchromium_src-9641e22aa3ab02a7ed362f9301c20fe8924aa842.zip
chromium_src-9641e22aa3ab02a7ed362f9301c20fe8924aa842.tar.gz
chromium_src-9641e22aa3ab02a7ed362f9301c20fe8924aa842.tar.bz2
Specify branch when fetching in sync-webkit-git.py.
This allows the fetch to succeed even when the current WebKit branch has a different remote than the magic gclient branch. BUG=63850 TEST=none Review URL: http://codereview.chromium.org/5185005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/sync-webkit-git.py')
-rwxr-xr-xtools/sync-webkit-git.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/sync-webkit-git.py b/tools/sync-webkit-git.py
index f54976c..96ecc15 100755
--- a/tools/sync-webkit-git.py
+++ b/tools/sync-webkit-git.py
@@ -30,12 +30,16 @@ def RunGit(command):
logging.info('Returned "%s"' % out)
return out
+def GetOverrideShortBranchName():
+ """Returns the user-configured override branch name, if any."""
+ override_config_name = 'chromium.sync-branch'
+ return RunGit(['config', '--get', override_config_name])
+
def GetGClientBranchName():
"""Returns the name of the magic branch that lets us know that DEPS is
managing the update cycle."""
# Is there an override branch specified?
- overide_config_name = 'chromium.sync-branch'
- override_branch_name = RunGit(['config', '--get', overide_config_name])
+ override_branch_name = GetOverrideShortBranchName()
if not override_branch_name:
return 'refs/heads/gclient' # No override, so return the default branch.
@@ -101,6 +105,16 @@ def FindSVNRev(target_rev):
print "Something has likely gone horribly wrong."
return None
+def GetRemote():
+ branch = GetOverrideShortBranchName()
+ if not branch:
+ branch = 'gclient'
+
+ remote = RunGit(['config', '--get', 'branch.' + branch + '.remote'])
+ if remote:
+ return remote
+ return 'origin'
+
def UpdateGClientBranch(webkit_rev, magic_gclient_branch):
"""Update the magic gclient branch to point at |webkit_rev|.
@@ -108,7 +122,8 @@ def UpdateGClientBranch(webkit_rev, magic_gclient_branch):
target = FindSVNRev(webkit_rev)
if not target:
print "r%s not available; fetching." % webkit_rev
- subprocess.check_call(['git', 'fetch'], shell=(os.name == 'nt'))
+ subprocess.check_call(['git', 'fetch', GetRemote()],
+ shell=(os.name == 'nt'))
target = FindSVNRev(webkit_rev)
if not target:
print "ERROR: Couldn't map r%s to a git revision." % webkit_rev