Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 """Performs all git-svn setup steps necessary for 'git svn dcommit' to work. | 6 """Performs all git-svn setup steps necessary for 'git svn dcommit' to work. |
| 7 | 7 |
| 8 Assumes that trunk of the svn remote maps to master of the git remote. | 8 Assumes that trunk of the svn remote maps to master of the git remote. |
| 9 | 9 |
| 10 Example: | 10 Example: |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 print 'Checking ', maybe_repo | 76 print 'Checking ', maybe_repo |
| 77 run_svn('info', maybe_repo) | 77 run_svn('info', maybe_repo) |
| 78 svn_repo = maybe_repo | 78 svn_repo = maybe_repo |
| 79 svn_path = '/'.join(path_components[i+1:]) | 79 svn_path = '/'.join(path_components[i+1:]) |
| 80 break | 80 break |
| 81 except subprocess2.CalledProcessError: | 81 except subprocess2.CalledProcessError: |
| 82 continue | 82 continue |
| 83 assert svn_repo is not None, 'Unable to find svn repo for %s' % match.group(1) | 83 assert svn_repo is not None, 'Unable to find svn repo for %s' % match.group(1) |
| 84 print 'Found upstream svn repo %s and path %s' % (svn_repo, svn_path) | 84 print 'Found upstream svn repo %s and path %s' % (svn_repo, svn_path) |
| 85 | 85 |
| 86 # TODO(kjellander): Remove when WebRTC has moved to Git (crbug.com/435091) | |
| 87 if svn_repo.startswith('http://'): | |
| 88 svn_repo = svn_repo.replace('http://', 'https://') | |
|
Michael Moss
2014/11/20 16:51:30
I'm generally in favor of this change, though I th
kjellander_chromium
2014/11/20 18:00:37
You're right, what about PS#2?
That should effect
| |
| 89 | |
| 86 set_config('svn-remote.svn.url', svn_repo) | 90 set_config('svn-remote.svn.url', svn_repo) |
| 87 set_config('svn-remote.svn.fetch', | 91 set_config('svn-remote.svn.fetch', |
| 88 '%s:refs/remotes/%s' % (svn_path, upstream)) | 92 '%s:refs/remotes/%s' % (svn_path, upstream)) |
| 89 print 'Configured metadata, running "git svn fetch". This may take some time.' | 93 print 'Configured metadata, running "git svn fetch". This may take some time.' |
| 90 for line in run_git_stream('svn', 'fetch').xreadlines(): | 94 for line in run_git_stream('svn', 'fetch').xreadlines(): |
| 91 print line.strip() | 95 print line.strip() |
| 92 | 96 |
| 93 | 97 |
| 94 if __name__ == '__main__': | 98 if __name__ == '__main__': |
| 95 sys.exit(main(sys.argv)) | 99 sys.exit(main(sys.argv)) |
| OLD | NEW |