OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """SVN to GIT mapping for the public Chromium repositories.""" | 6 """SVN to GIT mapping for the public Chromium repositories.""" |
7 | 7 |
8 import re | 8 import re |
9 | 9 |
10 | 10 |
11 GIT_HOST = 'https://chromium.googlesource.com/' | 11 GIT_HOST = 'https://chromium.googlesource.com/' |
12 | 12 |
13 BLINK_TRUNK_RE = re.compile( | 13 BLINK_TRUNK_RE = re.compile( |
14 '^https?://src.chromium.org/blink/trunk$') | 14 '^https?://src.chromium.org/blink/trunk$') |
15 BLINK_TRUNK_PUBLIC_RE = re.compile( | 15 BLINK_TRUNK_PUBLIC_RE = re.compile( |
16 '^https?://src.chromium.org/blink/trunk/public$') | 16 '^https?://src.chromium.org/blink/trunk/public$') |
17 | 17 |
18 # Used by deps2git.ConvertDepsToGit() as overrides for SVN DEPS. Each entry | |
19 # maps a DEPS path to a DEPS variable identifying the Git hash for its | |
20 # respective repository. Variables are automatically transferred from SVN DEPS | |
21 # to .DEPS.git and converted into variables by deps_utils.Varify(). | |
22 DEPS_OVERRIDES = { | |
23 'src/third_party/ffmpeg': 'ffmpeg_hash' | |
24 } | |
25 | |
26 | 18 |
27 def SvnUrlToGitUrl(path, svn_url): | 19 def SvnUrlToGitUrl(path, svn_url): |
28 """Convert a chromium SVN URL to a chromium Git URL.""" | 20 """Convert a chromium SVN URL to a chromium Git URL.""" |
29 | 21 |
30 match = re.match( | 22 match = re.match( |
31 '(https?://src.chromium.org/svn|svn://svn.chromium.org/chrome)(/.*)', | 23 '(https?://src.chromium.org/svn|svn://svn.chromium.org/chrome)(/.*)', |
32 svn_url) | 24 svn_url) |
33 if match: | 25 if match: |
34 svn_url = match.group(2) | 26 svn_url = match.group(2) |
35 | 27 |
(...skipping 23 matching lines...) Expand all Loading... |
59 | 51 |
60 if svn_url == 'svn://svn.chromium.org/boto': | 52 if svn_url == 'svn://svn.chromium.org/boto': |
61 return (path, GIT_HOST + 'external/boto.git', GIT_HOST) | 53 return (path, GIT_HOST + 'external/boto.git', GIT_HOST) |
62 | 54 |
63 if svn_url == 'svn://svn.chromium.org/gsutil/trunk/src': | 55 if svn_url == 'svn://svn.chromium.org/gsutil/trunk/src': |
64 return (path, GIT_HOST + 'external/gsutil/src.git', GIT_HOST) | 56 return (path, GIT_HOST + 'external/gsutil/src.git', GIT_HOST) |
65 | 57 |
66 if svn_url == 'svn://svn.chromium.org/jsoncpp/trunk/jsoncpp': | 58 if svn_url == 'svn://svn.chromium.org/jsoncpp/trunk/jsoncpp': |
67 return (path, GIT_HOST + 'external/jsoncpp/jsoncpp.git', GIT_HOST) | 59 return (path, GIT_HOST + 'external/jsoncpp/jsoncpp.git', GIT_HOST) |
68 | 60 |
69 if svn_url == '/trunk/deps/third_party/ffmpeg': | |
70 return (path, GIT_HOST + 'chromium/third_party/ffmpeg.git', GIT_HOST) | |
71 | |
72 if svn_url == '/trunk/deps/cdm': | 61 if svn_url == '/trunk/deps/cdm': |
73 return (path, GIT_HOST + 'chromium/cdm.git', GIT_HOST) | 62 return (path, GIT_HOST + 'chromium/cdm.git', GIT_HOST) |
74 | 63 |
75 # TODO(niklase) Remove after landing https://codereview.chromium.org/86563002 | 64 # TODO(niklase) Remove after landing https://codereview.chromium.org/86563002 |
76 if re.match('^https?://webrtc.googlecode.com/svn/stable/webrtc$', svn_url): | 65 if re.match('^https?://webrtc.googlecode.com/svn/stable/webrtc$', svn_url): |
77 return (path, GIT_HOST + 'external/webrtc/stable/webrtc.git', GIT_HOST) | 66 return (path, GIT_HOST + 'external/webrtc/stable/webrtc.git', GIT_HOST) |
78 | 67 |
79 # TODO(niklase) Remove after landing https://codereview.chromium.org/86563002 | 68 # TODO(niklase) Remove after landing https://codereview.chromium.org/86563002 |
80 if re.match('^https?://webrtc.googlecode.com/svn/stable/talk$', svn_url): | 69 if re.match('^https?://webrtc.googlecode.com/svn/stable/talk$', svn_url): |
81 return (path, GIT_HOST + 'external/webrtc/stable/talk.git', GIT_HOST) | 70 return (path, GIT_HOST + 'external/webrtc/stable/talk.git', GIT_HOST) |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 return (path, GIT_HOST + 'chromium/deps/%s' % repo, GIT_HOST) | 198 return (path, GIT_HOST + 'chromium/deps/%s' % repo, GIT_HOST) |
210 | 199 |
211 # Subdirectories of the chromium deps/reference_builds directory. | 200 # Subdirectories of the chromium deps/reference_builds directory. |
212 match = re.match('/trunk/deps/reference_builds/(.*)', svn_url) | 201 match = re.match('/trunk/deps/reference_builds/(.*)', svn_url) |
213 if match: | 202 if match: |
214 repo = '%s.git' % match.group(1) | 203 repo = '%s.git' % match.group(1) |
215 return (path, GIT_HOST + 'chromium/reference_builds/%s' % repo, GIT_HOST) | 204 return (path, GIT_HOST + 'chromium/reference_builds/%s' % repo, GIT_HOST) |
216 | 205 |
217 # Nothing yet? Oops. | 206 # Nothing yet? Oops. |
218 print 'No match for %s' % svn_url | 207 print 'No match for %s' % svn_url |
OLD | NEW |