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

Unified Diff: svn_to_git_public.py

Issue 9359045: Add support for non-git-svn repos. Fix syntax errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/deps2git/
Patch Set: Created 8 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 | « deps_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: svn_to_git_public.py
===================================================================
--- svn_to_git_public.py (revision 121912)
+++ svn_to_git_public.py (working copy)
@@ -3,15 +3,21 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+"""SVN to GIT mapping for the public Chromium repositories."""
-import os
import re
-import git_tools
+GIT_HOST = 'http://git.chromium.org/'
-GIT_HOST = 'http://git.chromium.org/'
+# Used by deps2git.ConvertDepsToGit() as overrides for SVN DEPS. Each entry
+# maps a DEPS path to a DEPS variable identifying the Git hash for its
+# respective repository. Variables are automatically transferred from SVN DEPS
+# to .DEPS.git and converted into variables by deps_utils.Varify().
+DEPS_OVERRIDES = {
+ 'src/third_party/ffmpeg': 'ffmpeg_hash'
+}
def SvnUrlToGitUrl(path, svn_url):
@@ -23,62 +29,66 @@
# A few special cases.
if svn_url == '/trunk/deps/page_cycler/acid3':
- return (path, 'http://git.chromium.org/chromium/deps/acid3.git')
+ return (path, GIT_HOST + 'chromium/deps/acid3.git')
if svn_url == '/trunk/deps/gpu/software_rendering_list':
- return (path, 'http://git.chromium.org/chromium/deps/gpu/software_rendering_list.git')
+ return (path, GIT_HOST + 'chromium/deps/gpu/software_rendering_list.git')
if svn_url == '/trunk/tools/third_party/python_26':
- return (path, 'http://git.chromium.org/chromium/deps/python_26.git')
+ return (path, GIT_HOST + 'chromium/deps/python_26.git')
if svn_url == '/trunk/deps/support':
- return (path, 'http://git.chromium.org/chromium/support.git')
+ return (path, GIT_HOST + 'chromium/support.git')
if svn_url == '/trunk/deps/frame_rate/content':
- return (path, 'http://git.chromium.org/chromium/frame_rate/content.git')
+ return (path, GIT_HOST + 'chromium/frame_rate/content.git')
if svn_url == 'svn://svn.chromium.org/jsoncpp/trunk/jsoncpp':
- return (path, 'http://git.chromium.org/external/jsoncpp/jsoncpp.git')
+ return (path, GIT_HOST + 'external/jsoncpp/jsoncpp.git')
+ if svn_url == '/trunk/deps/third_party/ffmpeg':
+ return (path, GIT_HOST + 'chromium/third_party/ffmpeg.git')
+
if svn_url in ('http://selenium.googlecode.com/svn/trunk/py/test',
'/trunk/deps/reference_builds/chrome'):
# Those can't be git svn cloned. Skipping for now.
return (None, None)
# Projects on sourceforge using trunk
- match = re.match('http?://(.*).svn.sourceforge.net/svnroot/(.*)/trunk(.*)', svn_url)
+ match = re.match('http?://(.*).svn.sourceforge.net/svnroot/(.*)/trunk(.*)',
+ svn_url)
if match:
repo = '%s%s.git' % (match.group(2), match.group(3))
- return (path, 'http://git.chromium.org/external/%s' % repo)
+ return (path, GIT_HOST + 'external/%s' % repo)
# Projects on googlecode.com using trunk.
match = re.match('http?://(.*).googlecode.com/svn/trunk(.*)', svn_url)
if match:
repo = '%s%s.git' % (match.group(1), match.group(2))
- return (path, 'http://git.chromium.org/external/%s' % repo)
+ return (path, GIT_HOST + 'external/%s' % repo)
# Projects on googlecode.com usng branches.
match = re.match('http://(.*).googlecode.com/svn/branches/(.*)', svn_url)
if match:
repo = '%s/%s.git' % (match.group(1), match.group(2))
- return (path, 'http://git.chromium.org/external/%s' % repo)
+ return (path, GIT_HOST + 'external/%s' % repo)
# Projects that are subdirectories of the native_client repository.
match = re.match('http://src.chromium.org/native_client/trunk/(.*)', svn_url)
if match:
repo = '%s.git' % match.group(1)
- return (path, 'http://git.chromium.org/native_client/%s' % repo)
+ return (path, GIT_HOST + 'native_client/%s' % repo)
# Projects that are subdirectories of the chromium/{src,tools} repository.
match = re.match('/trunk/((src|tools)/.*)', svn_url)
if match:
repo = '%s.git' % match.group(1)
- return (path, 'http://git.chromium.org/chromium/%s' % repo)
+ return (path, GIT_HOST + 'chromium/%s' % repo)
# Main webkit directory.
if svn_url == 'http://svn.webkit.org/repository/webkit/trunk/Source':
return ('src/third_party/WebKit',
- 'http://git.chromium.org/external/WebKit_trimmed.git')
+ GIT_HOST + 'external/WebKit_trimmed.git')
# Ignore all webkit directories, since we fetch the whole thing directly.
if svn_url == '/trunk/deps/third_party/WebKit':
@@ -91,13 +101,13 @@
match = re.match('/trunk/deps/third_party/(.*)', svn_url)
if match:
repo = '%s.git' % match.group(1)
- return (path, 'http://git.chromium.org/chromium/deps/%s' % repo)
+ return (path, GIT_HOST + 'chromium/deps/%s' % repo)
# Subdirectories of the chromium deps/reference_builds directory.
match = re.match('/trunk/deps/reference_builds/(.*)', svn_url)
if match:
repo = '%s.git' % match.group(1)
- return (path, 'http://git.chromium.org/chromium/reference_builds/%s' % repo)
+ return (path, GIT_HOST + 'chromium/reference_builds/%s' % repo)
# Nothing yet? Oops.
- print "No match for %s" % svn_url
+ print 'No match for %s' % svn_url
« no previous file with comments | « deps_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698