Skip to content
Snippets Groups Projects
Commit 9453a32c authored by evan@chromium.org's avatar evan@chromium.org
Browse files

sync-webkit-git: link to wiki, do some of Tony's review comments

I had committed before I got Tony's feedback.  This change does
some of his suggestions and migrates some info to the wiki.

Review URL: http://codereview.chromium.org/195098

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26286 0039d316-1c4b-4281-b951-d872f2087c98
parent 9543af05
No related branches found
No related tags found
No related merge requests found
......@@ -8,22 +8,8 @@
Under the assumption third_party/WebKit is a clone of git.webkit.org,
we can use git commands to make it match the version requested by DEPS.
To use this:
1) rm -rf third_party/WebKit
2) git clone git://git.webkit.org/WebKit.git third_party/WebKit
3) edit your .gclient "custom_deps" section to exclude components underneath
third_party/WebKit:
"src/third_party/WebKit/LayoutTests": None,
"src/third_party/WebKit/JavaScriptCore": None,
"src/third_party/WebKit/WebCore": None,
4) run ./tools/sync-webkit-git.py now, and again whenever you run gclient
sync.
FAQ:
Q. Why not add this functionality to gclient itself?
A. DEPS actually specifies to only pull some subdirectories of
third_party/WebKit. So even if gclient supported git, we'd still need
to special-case this.
See http://code.google.com/p/chromium/wiki/UsingWebKitGit for details on
how to use this.
"""
import os
......@@ -48,7 +34,8 @@ def GetWebKitRev():
def FindSVNRev(rev):
"""Map an SVN revision to a git hash.
Like 'git svn find-rev' but without the git-svn bits."""
return RunGit(['rev-list', '-n', '1', '--grep=^git-svn-id: .*@%s' % rev,
# We find r123 by grepping for a line with "git-svn-id: blahblahblah@123".
return RunGit(['rev-list', '-n', '1', '--grep=^git-svn-id: .*@%s$' % rev,
'origin'])
def UpdateGClientBranch(webkit_rev):
......@@ -76,7 +63,8 @@ def UpdateCurrentCheckoutIfAppropriate():
"""Reset the current gclient branch if that's what we have checked out."""
branch = RunGit(['symbolic-ref', '-q', 'HEAD'])
if branch != MAGIC_GCLIENT_BRANCH:
print "Directory has some other branch ('%s') checked out." % branch
print ("third_party/WebKit has some other branch ('%s') checked out." %
branch)
print "Run 'git checkout gclient' to put this under control of gclient."
return
......@@ -86,12 +74,20 @@ def UpdateCurrentCheckoutIfAppropriate():
subprocess.check_call(['git', 'reset', '--hard'])
def main():
if not os.path.exists('third_party/WebKit/.git'):
print "ERROR: third_party/WebKit appears to not be under git control."
print "See http://code.google.com/p/chromium/wiki/UsingWebKitGit for"
print "setup instructions."
return
webkit_rev = GetWebKitRev()
print 'Desired revision: r%s.' % webkit_rev
os.chdir('third_party/WebKit')
changed = UpdateGClientBranch(webkit_rev)
if changed:
UpdateCurrentCheckoutIfAppropriate()
else:
print "Already on correct revision."
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment