| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return (path, GIT_HOST + 'chromium/deps/%s' % repo, GIT_HOST) | 183 return (path, GIT_HOST + 'chromium/deps/%s' % repo, GIT_HOST) |
| 195 | 184 |
| 196 # Subdirectories of the chromium deps/reference_builds directory. | 185 # Subdirectories of the chromium deps/reference_builds directory. |
| 197 match = re.match('/trunk/deps/reference_builds/(.*)', svn_url) | 186 match = re.match('/trunk/deps/reference_builds/(.*)', svn_url) |
| 198 if match: | 187 if match: |
| 199 repo = '%s.git' % match.group(1) | 188 repo = '%s.git' % match.group(1) |
| 200 return (path, GIT_HOST + 'chromium/reference_builds/%s' % repo, GIT_HOST) | 189 return (path, GIT_HOST + 'chromium/reference_builds/%s' % repo, GIT_HOST) |
| 201 | 190 |
| 202 # Nothing yet? Oops. | 191 # Nothing yet? Oops. |
| 203 print 'No match for %s' % svn_url | 192 print 'No match for %s' % svn_url |
| OLD | NEW |